platformdirs
A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.
Install
platformdirs on PyPI
pip
pip install platformdirsuv
uv add platformdirspoetry
poetry add platformdirsPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: platformdirs-4.11.2-py3-none-any.whl
Keywords: appdirs, application, cache, directory, log, user
About platformdirs
from the package's own PyPI description — quoted content, verbatim
platformdirs
PyPI version (image) Python versions (image) CI (image) Downloads (image)
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
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/<uid>/MyApp (Linux)
For Path objects...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Determines platform-specific directories for application data, config, cache, logs, and user media folders across macOS, Windows, Linux, and Android.
Minimal friction: pure-Python wheel with zero runtime dependencies, active maintenance (release 3 days ago), and broad Python 3.10–3.15 support.
MIT permissive license allows unrestricted use, modification, and distribution in both open and proprietary projects.
Usage
from platformdirs import PlatformDirs
dirs = PlatformDirs("MyApp", "MyCompany")
print(dirs.user_config_dir) # ~/.config/MyApp on Linux
Requires Python 3.10 or later.
Verdict: A lightweight, actively maintained utility for cross-platform directory resolution with zero dependencies, MIT licensing, and top-100 PyPI popularity. Suitable for any application needing portable paths to user data, config, cache, or system directories.
Needs verification
- Whether the package handles edge cases on less common platforms (e.g., specific Android configurations) as documented.
- Performance characteristics when called repeatedly in tight loops or with many concurrent threads.
Similar packages
permissive · top 1,000 on PyPI
envierpermissive · top 1,000 on PyPI
toxpermissive · top 1,000 on PyPI
databricks-labs-blueprintunclear · top 1,000 on PyPI
filelockpermissive · top 100 on PyPI
entrypointspermissive · top 1,000 on PyPI
python-discoverypermissive · top 1,000 on PyPI
gunicornpermissive · top 1,000 on PyPI
cloudpathlibpermissive · top 1,000 on PyPI
universal-pathlibpermissive · top 1,000 on PyPI