platformdirs

Determine platform-specific user directories for data, config, cache, and logs

Library
PyPI
v4.11.3
971stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
88/100Excellent
Development Activity96
Maintenance100
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture80
Code Quality82
Innovation60
Learning Curve78

platformdirs (the maintained fork of the original appdirs) gives Python applications a single API for finding the correct OS-conventional directory for application data, configuration, cache, logs, and runtime files. It abstracts away the differences between macOS, Windows, Linux/Unix (including XDG Base Directory spec compliance), and Android, so applications don’t hardcode ~/.config or %APPDATA% paths themselves.

Beyond application-scoped directories, it also exposes standard user media folders (Documents, Downloads, Pictures, Desktop, and more) that aren’t tied to a specific app name. Every directory is available as both a string path and a pathlib.Path, via either a PlatformDirs object or standalone convenience functions.

What You Get

  • A PlatformDirs(appname, appauthor) class exposing user_data_dir, user_config_dir, user_cache_dir, user_state_dir, user_log_dir, and user_runtime_dir (plus site_* system-wide equivalents)
  • Both string-path (user_config_dir) and pathlib.Path (user_config_path) accessors for every directory kind
  • Standalone convenience functions (user_data_dir(), user_config_path(), etc.) for one-off lookups without instantiating a class
  • User media directory accessors — Documents, Downloads, Pictures, Videos, Music, Desktop, Templates, Fonts, and more — not scoped to an app name
  • Per-platform backends (unix.py, macos.py, windows.py, android.py) implementing XDG Base Directory spec on Linux, Apple conventions on macOS, and the Windows/Android equivalents

Common Use Cases

  • Storing a CLI tool’s config file in the OS-correct location instead of hardcoding ~/.config/myapp
  • Locating a safe, writable cache directory for downloaded assets or computed artifacts
  • Finding the right log directory per platform for a desktop or CLI application
  • Migrating from the unmaintained appdirs package to a drop-in, actively maintained replacement
  • Locating standard user folders (Downloads, Documents) for file-picker defaults in a cross-platform app

Under The Hood

Architecture: The public API in src/platformdirs/api.py defines an abstract base with all directory properties; unix.py, macos.py, windows.py, and android.py each provide a platform-specific subclass implementing those properties according to that OS’s conventions (XDG spec on Linux via _xdg.py, ~/Library/... on macOS, %APPDATA%/%LOCALAPPDATA% on Windows). __init__.py picks the correct backend at import time based on sys.platform and re-exports both the class and convenience functions.

Tech Stack: Pure Python with zero required runtime dependencies, supporting Python 3.9+. Packaged with a standard pyproject.toml/hatchling build, ships py.typed for full type-checker support, and publishes wheels plus an sdist to PyPI on every tagged release.

Code Quality: Each platform backend has a dedicated test module (tests/test_unix.py, test_macos.py, test_windows.py, test_android.py), plus test_api.py for the shared interface and test_comp_with_appdirs.py explicitly testing parity/behavioral differences against the legacy appdirs package it forked from. CI runs across all four backends and multiple Python versions via GitHub Actions.

API Design: The dual surface — a PlatformDirs class for apps that need many directories at once, plus flat convenience functions (user_data_dir(appname)) for one-off lookups — lets callers pick the ergonomics that fit their use case with zero required configuration beyond an app name.

Used by 12 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
76%
MIT

ArchiveBox

Bookmarks Archiving

28,138

Self-hosted web archiving that saves HTML, PDFs, screenshots, media, and code in open formats you own forever

View details
88
Repo Health
84
Technical
70
Dependency
Built with
Python76%
HTML12%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
JavaScript
35%
MPL 2.0

Zen Browser

Browser

43,977

A Firefox-based browser that puts focus, privacy, and workflow front-and-centre without sacrificing compatibility

View details
88
Repo Health
81
Technical
80
Dependency
Built with
JavaScript35%
Fluent28%
C++24%
Updated yesterday
TypeScript
97%
Other

GrowthBook

Developer Tools · Analytics · Monitoring

8,138

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript97%
Updated today
Python
68%
MIT

Langflow

AI Agents · AI Development

153,450

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
66
Dependency
Built with
Python68%
TypeScript22%
Updated today
C++
66%
Other

Memgraph

Databases · AI Development

4,347

High-performance in-memory graph database for AI context and real-time analytics

View details
90
Repo Health
79
Technical
70
Dependency
Built with
C++66%
Python18%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search