{"id":15025477,"url":"https://github.com/activestate/appdirs","last_synced_at":"2025-05-14T02:04:55.068Z","repository":{"id":550086,"uuid":"802133","full_name":"ActiveState/appdirs","owner":"ActiveState","description":"A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\".","archived":false,"fork":false,"pushed_at":"2023-02-10T23:42:40.000Z","size":157,"stargazers_count":1063,"open_issues_count":49,"forks_count":98,"subscribers_count":66,"default_branch":"master","last_synced_at":"2025-05-07T00:02:49.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/appdirs","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ActiveState.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2010-07-28T04:07:00.000Z","updated_at":"2025-04-24T08:53:58.000Z","dependencies_parsed_at":"2023-02-11T23:01:35.417Z","dependency_job_id":null,"html_url":"https://github.com/ActiveState/appdirs","commit_stats":{"total_commits":169,"total_committers":37,"mean_commits":"4.5675675675675675","dds":0.834319526627219,"last_synced_commit":"8734277956c1df3b85385e6b308e954910533884"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fappdirs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fappdirs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fappdirs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fappdirs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActiveState","download_url":"https://codeload.github.com/ActiveState/appdirs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052692,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:02:26.492Z","updated_at":"2025-05-14T02:04:55.044Z","avatar_url":"https://github.com/ActiveState.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://secure.travis-ci.org/ActiveState/appdirs.png\n    :target: https://travis-ci.org/ActiveState/appdirs\n\nNote: This project has been officially deprecated. You may want to check out https://pypi.org/project/platformdirs/ which is a more active fork of appdirs. Thanks to everyone who has used appdirs. Shout out to ActiveState for the time they gave their employees to work on this over the years.\n\nthe problem\n===========\n\nWhat directory should your app use for storing user data? If running on macOS, you\nshould use::\n\n    ~/Library/Application Support/\u003cAppName\u003e\n\nIf on Windows (at least English Win XP) that should be::\n\n    C:\\Documents and Settings\\\u003cUser\u003e\\Application Data\\Local Settings\\\u003cAppAuthor\u003e\\\u003cAppName\u003e\n\nor possibly::\n\n    C:\\Documents and Settings\\\u003cUser\u003e\\Application Data\\\u003cAppAuthor\u003e\\\u003cAppName\u003e\n\nfor `roaming profiles \u003chttps://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc766489(v=ws.10)\u003e`_ but that is another story.\n\nOn Linux (and other Unices) the dir, according to the `XDG\nspec \u003chttps://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html\u003e`_, is::\n\n    ~/.local/share/\u003cAppName\u003e\n\n\n``appdirs`` to the rescue\n=========================\n\nThis kind of thing is what the ``appdirs`` module is for. ``appdirs`` will\nhelp you choose an appropriate:\n\n- user data dir (``user_data_dir``)\n- user config dir (``user_config_dir``)\n- user cache dir (``user_cache_dir``)\n- site data dir (``site_data_dir``)\n- site config dir (``site_config_dir``)\n- user log dir (``user_log_dir``)\n\nand also:\n\n- is a single module so other Python packages can include their own private copy\n- is slightly opinionated on the directory names used. Look for \"OPINION\" in\n  documentation and code for when an opinion is being applied.\n\n\nsome example output\n===================\n\nOn macOS::\n\n    \u003e\u003e\u003e from appdirs import *\n    \u003e\u003e\u003e appname = \"SuperApp\"\n    \u003e\u003e\u003e appauthor = \"Acme\"\n    \u003e\u003e\u003e user_data_dir(appname, appauthor)\n    '/Users/trentm/Library/Application Support/SuperApp'\n    \u003e\u003e\u003e site_data_dir(appname, appauthor)\n    '/Library/Application Support/SuperApp'\n    \u003e\u003e\u003e user_cache_dir(appname, appauthor)\n    '/Users/trentm/Library/Caches/SuperApp'\n    \u003e\u003e\u003e user_log_dir(appname, appauthor)\n    '/Users/trentm/Library/Logs/SuperApp'\n\nOn Windows 7::\n\n    \u003e\u003e\u003e from appdirs import *\n    \u003e\u003e\u003e appname = \"SuperApp\"\n    \u003e\u003e\u003e appauthor = \"Acme\"\n    \u003e\u003e\u003e user_data_dir(appname, appauthor)\n    'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Acme\\\\SuperApp'\n    \u003e\u003e\u003e user_data_dir(appname, appauthor, roaming=True)\n    'C:\\\\Users\\\\trentm\\\\AppData\\\\Roaming\\\\Acme\\\\SuperApp'\n    \u003e\u003e\u003e user_cache_dir(appname, appauthor)\n    'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Acme\\\\SuperApp\\\\Cache'\n    \u003e\u003e\u003e user_log_dir(appname, appauthor)\n    'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Acme\\\\SuperApp\\\\Logs'\n\nOn Linux::\n\n    \u003e\u003e\u003e from appdirs import *\n    \u003e\u003e\u003e appname = \"SuperApp\"\n    \u003e\u003e\u003e appauthor = \"Acme\"\n    \u003e\u003e\u003e user_data_dir(appname, appauthor)\n    '/home/trentm/.local/share/SuperApp\n    \u003e\u003e\u003e site_data_dir(appname, appauthor)\n    '/usr/local/share/SuperApp'\n    \u003e\u003e\u003e site_data_dir(appname, appauthor, multipath=True)\n    '/usr/local/share/SuperApp:/usr/share/SuperApp'\n    \u003e\u003e\u003e user_cache_dir(appname, appauthor)\n    '/home/trentm/.cache/SuperApp'\n    \u003e\u003e\u003e user_log_dir(appname, appauthor)\n    '/home/trentm/.cache/SuperApp/log'\n    \u003e\u003e\u003e user_config_dir(appname)\n    '/home/trentm/.config/SuperApp'\n    \u003e\u003e\u003e site_config_dir(appname)\n    '/etc/xdg/SuperApp'\n    \u003e\u003e\u003e os.environ['XDG_CONFIG_DIRS'] = '/etc:/usr/local/etc'\n    \u003e\u003e\u003e site_config_dir(appname, multipath=True)\n    '/etc/SuperApp:/usr/local/etc/SuperApp'\n\n\n``AppDirs`` for convenience\n===========================\n\n::\n\n    \u003e\u003e\u003e from appdirs import AppDirs\n    \u003e\u003e\u003e dirs = AppDirs(\"SuperApp\", \"Acme\")\n    \u003e\u003e\u003e dirs.user_data_dir\n    '/Users/trentm/Library/Application Support/SuperApp'\n    \u003e\u003e\u003e dirs.site_data_dir\n    '/Library/Application Support/SuperApp'\n    \u003e\u003e\u003e dirs.user_cache_dir\n    '/Users/trentm/Library/Caches/SuperApp'\n    \u003e\u003e\u003e dirs.user_log_dir\n    '/Users/trentm/Library/Logs/SuperApp'\n\n\n    \nPer-version isolation\n=====================\n\nIf you have multiple versions of your app in use that you want to be\nable to run side-by-side, then you may want version-isolation for these\ndirs::\n\n    \u003e\u003e\u003e from appdirs import AppDirs\n    \u003e\u003e\u003e dirs = AppDirs(\"SuperApp\", \"Acme\", version=\"1.0\")\n    \u003e\u003e\u003e dirs.user_data_dir\n    '/Users/trentm/Library/Application Support/SuperApp/1.0'\n    \u003e\u003e\u003e dirs.site_data_dir\n    '/Library/Application Support/SuperApp/1.0'\n    \u003e\u003e\u003e dirs.user_cache_dir\n    '/Users/trentm/Library/Caches/SuperApp/1.0'\n    \u003e\u003e\u003e dirs.user_log_dir\n    '/Users/trentm/Library/Logs/SuperApp/1.0'\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivestate%2Fappdirs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivestate%2Fappdirs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivestate%2Fappdirs/lists"}