App Filesystems

Manage filesystems in platform-specific application directories.

These classes abstract away the different requirements for user data across platforms, which vary in their conventions. They are all subclasses of OSFS.

class fs.appfs.UserDataFS(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True)[source]

A filesystem for per-user application data.

May also be opened with open_fs('userdata://appname:author:version').

__init__(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True) → None

Create a new application-specific filesystem.

Parameters
  • appname (str) – The name of the application.

  • author (str) – The name of the author (used on Windows).

  • version (str) – Optional version string, if a unique location per version of the application is required.

  • roaming (bool) – If True, use a roaming profile on Windows.

  • create (bool) – If True (the default) the directory will be created if it does not exist.

class fs.appfs.UserConfigFS(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True)[source]

A filesystem for per-user config data.

May also be opened with open_fs('userconf://appname:author:version').

__init__(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True) → None

Create a new application-specific filesystem.

Parameters
  • appname (str) – The name of the application.

  • author (str) – The name of the author (used on Windows).

  • version (str) – Optional version string, if a unique location per version of the application is required.

  • roaming (bool) – If True, use a roaming profile on Windows.

  • create (bool) – If True (the default) the directory will be created if it does not exist.

class fs.appfs.SiteDataFS(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True)[source]

A filesystem for application site data.

May also be opened with open_fs('sitedata://appname:author:version').

__init__(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True) → None

Create a new application-specific filesystem.

Parameters
  • appname (str) – The name of the application.

  • author (str) – The name of the author (used on Windows).

  • version (str) – Optional version string, if a unique location per version of the application is required.

  • roaming (bool) – If True, use a roaming profile on Windows.

  • create (bool) – If True (the default) the directory will be created if it does not exist.

class fs.appfs.SiteConfigFS(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True)[source]

A filesystem for application config data.

May also be opened with open_fs('siteconf://appname:author:version').

__init__(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True) → None

Create a new application-specific filesystem.

Parameters
  • appname (str) – The name of the application.

  • author (str) – The name of the author (used on Windows).

  • version (str) – Optional version string, if a unique location per version of the application is required.

  • roaming (bool) – If True, use a roaming profile on Windows.

  • create (bool) – If True (the default) the directory will be created if it does not exist.

class fs.appfs.UserCacheFS(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True)[source]

A filesystem for per-user application cache data.

May also be opened with open_fs('usercache://appname:author:version').

__init__(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True) → None

Create a new application-specific filesystem.

Parameters
  • appname (str) – The name of the application.

  • author (str) – The name of the author (used on Windows).

  • version (str) – Optional version string, if a unique location per version of the application is required.

  • roaming (bool) – If True, use a roaming profile on Windows.

  • create (bool) – If True (the default) the directory will be created if it does not exist.

class fs.appfs.UserLogFS(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True)[source]

A filesystem for per-user application log data.

May also be opened with open_fs('userlog://appname:author:version').

__init__(appname: Text, author: Optional[Text] = None, version: Optional[Text] = None, roaming: bool = False, create: bool = True) → None

Create a new application-specific filesystem.

Parameters
  • appname (str) – The name of the application.

  • author (str) – The name of the author (used on Windows).

  • version (str) – Optional version string, if a unique location per version of the application is required.

  • roaming (bool) – If True, use a roaming profile on Windows.

  • create (bool) – If True (the default) the directory will be created if it does not exist.