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.1.tar.gz (25.3 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.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: platformdirs-4.7.1.tar.gz
  • Upload date:
  • Size: 25.3 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.1.tar.gz
Algorithm Hash digest
SHA256 6f4ff8472e482af4b7e67a183fbe63da846a9b34f57d5019c4d112a181003d82
MD5 54a984dcc7679ced2d5ef9749971a04f
BLAKE2b-256 d33ec81eb24fb98b00bc097b9ce5dee6eca020c52619ed95b246aaec2018c511

See more details on using hashes here.

Provenance

The following attestation bundles were made for platformdirs-4.7.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: platformdirs-4.7.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06ac79ae0c5025949f62711e3f7cd178736515a29bcc669f42a216016cd1dc7a
MD5 8b60be664589a527f8458e672be3551f
BLAKE2b-256 d18236dcca0cfa42ad259bf0eb1f7af0d5759710c21928856891631cb47e4771

See more details on using hashes here.

Provenance

The following attestation bundles were made for platformdirs-4.7.1-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