METADATA 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Metadata-Version: 2.4
  2. Name: platformdirs
  3. Version: 4.9.4
  4. Summary: A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.
  5. Project-URL: Changelog, https://platformdirs.readthedocs.io/en/latest/changelog.html
  6. Project-URL: Documentation, https://platformdirs.readthedocs.io
  7. Project-URL: Homepage, https://github.com/tox-dev/platformdirs
  8. Project-URL: Source, https://github.com/tox-dev/platformdirs
  9. Project-URL: Tracker, https://github.com/tox-dev/platformdirs/issues
  10. Maintainer-email: Bernát Gábor <gaborjbernat@gmail.com>, Julian Berman <Julian@GrayVines.com>, Ofek Lev <oss@ofek.dev>, Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
  11. License-Expression: MIT
  12. License-File: LICENSE
  13. Keywords: appdirs,application,cache,directory,log,user
  14. Classifier: Development Status :: 5 - Production/Stable
  15. Classifier: Intended Audience :: Developers
  16. Classifier: License :: OSI Approved :: MIT License
  17. Classifier: Operating System :: OS Independent
  18. Classifier: Programming Language :: Python
  19. Classifier: Programming Language :: Python :: 3 :: Only
  20. Classifier: Programming Language :: Python :: 3.10
  21. Classifier: Programming Language :: Python :: 3.11
  22. Classifier: Programming Language :: Python :: 3.12
  23. Classifier: Programming Language :: Python :: 3.13
  24. Classifier: Programming Language :: Python :: 3.14
  25. Classifier: Programming Language :: Python :: Implementation :: CPython
  26. Classifier: Programming Language :: Python :: Implementation :: PyPy
  27. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  28. Requires-Python: >=3.10
  29. Description-Content-Type: text/markdown
  30. # platformdirs
  31. [![PyPI version](https://badge.fury.io/py/platformdirs.svg)](https://badge.fury.io/py/platformdirs)
  32. [![Python versions](https://img.shields.io/pypi/pyversions/platformdirs.svg)](https://pypi.python.org/pypi/platformdirs/)
  33. [![CI](https://github.com/tox-dev/platformdirs/actions/workflows/check.yaml/badge.svg)](https://github.com/platformdirs/platformdirs/actions)
  34. [![Downloads](https://static.pepy.tech/badge/platformdirs/month)](https://pepy.tech/project/platformdirs)
  35. A Python package for determining platform-specific directories (e.g. user data, config, cache, logs). Handles the
  36. differences between macOS, Windows, Linux/Unix, and Android so you don't have to.
  37. ## Quick start
  38. ```python
  39. from platformdirs import PlatformDirs
  40. dirs = PlatformDirs("MyApp", "MyCompany")
  41. dirs.user_data_dir # ~/.local/share/MyApp (Linux)
  42. dirs.user_config_dir # ~/.config/MyApp (Linux)
  43. dirs.user_cache_dir # ~/.cache/MyApp (Linux)
  44. dirs.user_state_dir # ~/.local/state/MyApp (Linux)
  45. dirs.user_log_dir # ~/.local/state/MyApp/log (Linux)
  46. dirs.user_documents_dir # ~/Documents
  47. dirs.user_downloads_dir # ~/Downloads
  48. dirs.user_runtime_dir # /run/user/<uid>/MyApp (Linux)
  49. ```
  50. For Path objects instead of strings:
  51. ```python
  52. from platformdirs import PlatformDirs
  53. dirs = PlatformDirs("MyApp", "MyCompany")
  54. dirs.user_data_path # pathlib.Path('~/.local/share/MyApp')
  55. dirs.user_config_path # pathlib.Path('~/.config/MyApp')
  56. ```
  57. Convenience functions for quick access:
  58. ```python
  59. from platformdirs import user_data_dir, user_config_path
  60. user_data_dir("MyApp", "MyCompany") # returns str
  61. user_config_path("MyApp", "MyCompany") # returns pathlib.Path
  62. ```
  63. ## Directory types
  64. - **Data**: Persistent application data (`user_data_dir`, `site_data_dir`)
  65. - **Config**: Configuration files and settings (`user_config_dir`, `site_config_dir`)
  66. - **Cache**: Cached data that can be regenerated (`user_cache_dir`, `site_cache_dir`)
  67. - **State**: Non-essential runtime state like window positions (`user_state_dir`, `site_state_dir`)
  68. - **Logs**: Log files (`user_log_dir`, `site_log_dir`)
  69. - **Runtime**: Runtime files like sockets and PIDs (`user_runtime_dir`, `site_runtime_dir`)
  70. Each type has both `user_*` (per-user, writable) and `site_*` (system-wide, read-only for users) variants.
  71. ## Documentation
  72. Full documentation is available at [platformdirs.readthedocs.io](https://platformdirs.readthedocs.io):
  73. - **[Getting started tutorial](https://platformdirs.readthedocs.io/en/latest/tutorial.html)** -- learn core concepts
  74. through real-world examples
  75. - **[How-to guides](https://platformdirs.readthedocs.io/en/latest/howto.html)** -- recipes for common tasks and
  76. platform-specific tips
  77. - **[API reference](https://platformdirs.readthedocs.io/en/latest/api.html)** -- complete list of functions and classes
  78. - **[Platform details](https://platformdirs.readthedocs.io/en/latest/platforms.html)** -- default paths for each
  79. operating system
  80. Contributions are welcome! See [CONTRIBUTING.md](https://github.com/tox-dev/platformdirs/blob/main/CONTRIBUTING.md) for
  81. details.