# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-platformdirs VERSION= 4.5.0 KEYWORDS= python VARIANTS= v13 v14 SDESC[v13]= Finds platform-specific directories (3.13) SDESC[v14]= Finds platform-specific directories (3.14) HOMEPAGE= https://github.com/tox-dev/platformdirs CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/73/cb/ac7874b3e5d58441674fb70742e6c374b28b0c7cb988d37d991cde47166c DISTFILE[1]= platformdirs-4.5.0-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v13]= single SPKGS[v14]= single OPTIONS_AVAILABLE= PY313 PY314 OPTIONS_STANDARD= none VOPTS[v13]= PY313=ON PY314=OFF VOPTS[v14]= PY313=OFF PY314=ON DISTNAME= platformdirs-4.5.0.dist-info GENERATED= yes [PY313].USES_ON= python:v13,wheel [PY314].USES_ON= python:v14,wheel [FILE:2868:descriptions/desc.single] The problem =========== When writing desktop application, finding the right location to store user data and configuration varies per platform. Even for single-platform apps, there may by plenty of nuances in figuring out the right location. For example, if running on macOS, you should use:: ~/Library/Application Support/ If on Windows (at least English Win) that should be:: C:\Users\\Application Data\Local Settings\\ or possibly:: C:\Users\\Application Data\\ for [roaming profiles] but that is another story. On Linux (and other Unices), according to the `XDG Basedir Spec`_, it should be:: ~/.local/share/ .. _XDG Basedir Spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html platformdirs to the rescue ============================== This kind of thing is what the platformdirs package is for. platformdirs will help you choose an appropriate: - user data dir (user_data_dir) - user config dir (user_config_dir) - user cache dir (user_cache_dir) - site data dir (site_data_dir) - site config dir (site_config_dir) - user log dir (user_log_dir) - user documents dir (user_documents_dir) - user downloads dir (user_downloads_dir) - user pictures dir (user_pictures_dir) - user videos dir (user_videos_dir) - user music dir (user_music_dir) - user desktop dir (user_desktop_dir) - user runtime dir (user_runtime_dir) And also: - Is slightly opinionated on the directory names used. Look for "OPINION" in documentation and code for when an opinion is being applied. Example output ============== On macOS: .. code-block:: pycon >>> from platformdirs import * >>> appname = "SuperApp" >>> appauthor = "Acme" >>> user_data_dir(appname, appauthor) '/Users/trentm/Library/Application Support/SuperApp' >>> user_config_dir(appname, appauthor) '/Users/trentm/Library/Application Support/SuperApp' >>> user_cache_dir(appname, appauthor) '/Users/trentm/Library/Caches/SuperApp' >>> site_data_dir(appname, appauthor) '/Library/Application Support/SuperApp' >>> site_config_dir(appname, appauthor) '/Library/Application Support/SuperApp' >>> user_log_dir(appname, appauthor) '/Users/trentm/Library/Logs/SuperApp' >>> user_documents_dir() '/Users/trentm/Documents' >>> user_downloads_dir() '/Users/trentm/Downloads' >>> user_pictures_dir() '/Users/trentm/Pictures' >>> user_videos_dir() '/Users/trentm/Movies' >>> user_music_dir() '/Users/trentm/Music' >>> user_desktop_dir() '/Users/trentm/Desktop' >>> user_runtime_dir(appname, appauthor) '/Users/trentm/Library/Caches/TemporaryItems/SuperApp' On Windows: .. code-block:: pycon >>> from platformdirs import * >>> appname = "SuperApp" >>> appauthor = "Acme" [FILE:125:distinfo] e578a81bb873cbb89a41fcc904c7ef523cc18284b7e3b3ccf06aca1403b7ebd3 18651 python-src/platformdirs-4.5.0-py3-none-any.whl