python-platformdirs
Port variant v13
Summary Finds platform-specific directories (3.13)
Package version 4.9.4
Homepage https://github.com/tox-dev/platformdirs
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v14
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 24 MAR 2026, 14:46:45 UTC
Port created 15 JUL 2021, 22:41:18 UTC
Subpackage Descriptions
single # platformdirs [PyPI version] [Python versions] [CI] [Downloads] A Python package for determining platform-specific directories (e.g. user data, config, cache, logs). Handles the differences between macOS, Windows, Linux/Unix, and Android so you don't have to. ## Quick start ```python from platformdirs import PlatformDirs dirs = PlatformDirs("MyApp", "MyCompany") dirs.user_data_dir # ~/.local/share/MyApp (Linux) dirs.user_config_dir # ~/.config/MyApp (Linux) dirs.user_cache_dir # ~/.cache/MyApp (Linux) dirs.user_state_dir # ~/.local/state/MyApp (Linux) dirs.user_log_dir # ~/.local/state/MyApp/log (Linux) dirs.user_documents_dir # ~/Documents dirs.user_downloads_dir # ~/Downloads dirs.user_runtime_dir # /run/user//MyApp (Linux) ``` For Path objects instead of strings: ```python from platformdirs import PlatformDirs dirs = PlatformDirs("MyApp", "MyCompany") dirs.user_data_path # pathlib.Path('~/.local/share/MyApp') dirs.user_config_path # pathlib.Path('~/.config/MyApp') ``` Convenience functions for quick access: ```python from platformdirs import user_data_dir, user_config_path user_data_dir("MyApp", "MyCompany") # returns str user_config_path("MyApp", "MyCompany") # returns pathlib.Path ``` ## Directory types - **Data**: Persistent application data (`user_data_dir`, `site_data_dir`) - **Config**: Configuration files and settings (`user_config_dir`, `site_config_dir`) - **Cache**: Cached data that can be regenerated (`user_cache_dir`, `site_cache_dir`) - **State**: Non-essential runtime state like window positions (`user_state_dir`, `site_state_dir`) - **Logs**: Log files (`user_log_dir`, `site_log_dir`) - **Runtime**: Runtime files like sockets and PIDs (`user_runtime_dir`, `site_runtime_dir`) Each type has both `user_*` (per-user, writable) and `site_*` (system-wide, read-only for users) variants. ## Documentation Full documentation is available at [platformdirs.readthedocs.io]: - **[Getting started tutorial]** -- learn core concepts through real-world examples - **[How-to guides]** -- recipes for common tasks and platform-specific tips - **[API reference]** -- complete list of functions and classes - **[Platform details]** -- default paths for each operating system Contributions are welcome! See [CONTRIBUTING.md] for details.
Configuration Switches (platform-specific settings discarded)
PY313 ON Build using Python 3.13 PY314 OFF Build using Python 3.14
Package Dependencies by Type
Build (only) python313:dev:std
python-pip:single:v13
autoselect-python:single:std
Build and Runtime python313:primary:std
Download groups
main mirror://PYPIWHL/63/d7/97f7e3a6abb67d8080dd406fd4df842c2be0efaf712d1c899c32a075027c
Distribution File Information
68a9a4619a666ea6439f2ff250c12a853cd1cbd5158d258bd824a7df6be2f868 21216 python-src/platformdirs-4.9.4-py3-none-any.whl
Ports that require python-platformdirs:v13
python-black:v13 Uncompromising code formatter (3.13)
python-mkdocs-get-deps:v13 List dependencies from by mydocs.yml file (3.13)
python-pylint:v13 Python code static checker (3.13)
python-python-discovery:v13 Python interpreter discovery (3.13)
python-requests-cache:v13 Persistent cache for python requests (3.13)
python-virtualenv:v13 Virtual Python Environment builder (3.13)
python-xml2rfc:v13 Request For Comment authoring with XML (3.13)
python-yapf:v13 Formatter for Python code (3.13)