skillfed

platformdirs

A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.

platformdirs Permissive license MIT Active 969 v4.11.2 released

Install

platformdirs on PyPI

pip

pip install platformdirs

uv

uv add platformdirs

poetry

poetry add platformdirs

Package 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

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.
platform specific directoriesuser data dir config cachecross platform app directoriesxdg base directoryapplication paths by osuser home directoriessystem cache log paths

Similar packages