Skip to main content

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

Project description

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

from platformdirs import PlatformDirs

dirs = PlatformDirs("MyApp", "MyCompany")
dirs.user_data_dir  # e.g. ~/.local/share/MyApp on Linux
dirs.user_config_dir  # e.g. ~/.config/MyApp on Linux
dirs.user_cache_dir  # e.g. ~/.cache/MyApp on Linux
dirs.user_log_dir  # e.g. ~/.local/state/MyApp/log on Linux

Convenience functions are also available:

from platformdirs import user_data_dir, user_config_path

user_data_dir("MyApp", "MyCompany")  # returns str
user_config_path("MyApp", "MyCompany")  # returns pathlib.Path

Documentation

Full documentation is available at platformdirs.readthedocs.io, including:

Why this fork?

This repository is a friendly fork of the wonderful work started by ActiveState who created appdirs, this package's ancestor.

Maintaining an open source project is no easy task, particularly from within an organization, and the Python community is indebted to appdirs (and to Trent Mick and Jeff Rouse in particular) for creating an incredibly useful simple module, as evidenced by the wide number of users it has attracted over the years.

Nonetheless, given the number of long-standing open issues and pull requests, and no clear path towards ensuring that maintenance of the package would continue or grow, this fork was created.

Contributions are most welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

platformdirs-4.7.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

platformdirs-4.7.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file platformdirs-4.7.0.tar.gz.

File metadata

  • Download URL: platformdirs-4.7.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for platformdirs-4.7.0.tar.gz
Algorithm Hash digest
SHA256 fd1a5f8599c85d49b9ac7d6e450bc2f1aaf4a23f1fe86d09952fe20ad365cf36
MD5 3808d8286e45848ef5294b6941960605
BLAKE2b-256 7125ccd8e88fcd16a4eb6343a8b4b9635e6f3928a7ebcd82822a14d20e3ca29f

See more details on using hashes here.

Provenance

The following attestation bundles were made for platformdirs-4.7.0.tar.gz:

Publisher: release.yaml on tox-dev/platformdirs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file platformdirs-4.7.0-py3-none-any.whl.

File metadata

  • Download URL: platformdirs-4.7.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for platformdirs-4.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ed8db354e344c5bb6039cd727f096af975194b508e37177719d562b2b540ee6
MD5 fc69a981072cd7335f0761965991251b
BLAKE2b-256 cbe31eddccb2c39ecfbe09b3add42a04abcc3fa5b468aa4224998ffb8a7e9c8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for platformdirs-4.7.0-py3-none-any.whl:

Publisher: release.yaml on tox-dev/platformdirs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page