platformdirs
A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.
Decision gist · record as of 2026-08-14
Yes. platformdirs is a stable, actively maintained utility with zero dependencies, no known vulnerabilities, and a permissive MIT license. It solves a genuine cross-platform problem that most GUI and CLI applications face. At top-100 popularity with recent activity, it's a safe, standard choice for any Python application that needs to respect OS directory conventions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction installation with no runtime dependencies.
- Active maintenance with a release 1 day ago and 969 repository stars.
- Supports Python 3.10 through 3.15 on CPython and PyPy.
License · maintenance · safety
MIT (permissive) — MIT license (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-08-13 (1 days) · last repo commit 2026-08-13 · 969 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 763,006,168 downloads/mo, #39 on PyPI
Alternatives
Verify before relying
from platformdirs import PlatformDirs
dirs = PlatformDirs("MyApp", "MyCompany")
print(dirs.user_data_dir) # ~/.local/share/MyApp (Linux)
print(dirs.user_config_dir) # ~/.config/MyApp (Linux)What it is and what it does
platformdirs is a lightweight utility that abstracts away the differences in where applications should store user data, configuration, cache, logs, and other files across different operating systems. Instead of hardcoding paths or writing platform detection logic yourself, you instantiate a PlatformDirs object with your app name and company, then access properties like user_data_dir, user_config_dir, or user_cache_dir—each returns the correct platform-native path for that directory type.
The package handles both application-scoped directories (which include your app name in the path) and standard user media directories (Documents, Downloads, Pictures, etc.). It provides both string paths and pathlib.Path objects, plus convenience functions for quick one-off lookups. With no runtime dependencies and support for current Python versions, it's designed to be a drop-in solution for any application that needs to respect platform conventions.
Use it for
- Store application configuration files in the OS-appropriate location without manual path detection.
- Cache downloaded or generated data in the system cache directory that the OS may clean up.
- Write application logs to the correct platform-specific log directory.
- Locate user Documents, Downloads, or Desktop folders in a cross-platform way.
- Determine where to install user-level executables or application shortcuts.
- Store application state (window positions, session data) in the runtime or state directory.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
platformdirs is a stable, actively maintained utility with zero dependencies, no known vulnerabilities, and a permissive MIT license. It solves a genuine cross-platform problem that most GUI and CLI applications face. At top-100 popularity with recent activity, it's a safe, standard choice for any Python application that needs to respect OS directory conventions.
Install
platformdirs on PyPI
Before you install
Low friction installation with no runtime dependencies. Active maintenance with a release 1 day ago and 969 repository stars. Supports Python 3.10 through 3.15 on CPython and PyPy.
License in practice
MIT license (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from platformdirs import PlatformDirs
dirs = PlatformDirs("MyApp", "MyCompany")
print(dirs.user_data_dir) # ~/.local/share/MyApp (Linux)
print(dirs.user_config_dir) # ~/.config/MyApp (Linux)
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 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 763,006,168 / month, #39 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | 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 |
Evidence: platformdirs-4.11.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “platform-specific directories”
- platformdirsDetermines platform-specific directories for application data,…
- appdirsDetermines the correct platform-specific directory for storing…
- appdataProvides a cross-platform abstraction for managing application data…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also appdata · appdirs · pox · findlibs · xdg-base-dirs · xdg · pystow · pyrootutils · pyprojroot · PyQt5