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, author=None, version=None, roaming=False, create=True)

A filesystem for per-user application data.

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

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, author=None, version=None, roaming=False, create=True)

A filesystem for per-user config data.

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

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, author=None, version=None, roaming=False, create=True)

A filesystem for application site data.

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

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, author=None, version=None, roaming=False, create=True)

A filesystem for application config data.

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

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, author=None, version=None, roaming=False, create=True)

A filesystem for per-user application cache data.

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

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, author=None, version=None, roaming=False, create=True)

A filesystem for per-user application log data.

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

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.