Refactor code structure for improved readability and maintainability
This commit is contained in:
parent
389d72a136
commit
aa4c067ea8
1685 changed files with 393439 additions and 71932 deletions
|
|
@ -0,0 +1 @@
|
|||
pip
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
Metadata-Version: 2.4
|
||||
Name: platformdirs
|
||||
Version: 4.9.4
|
||||
Summary: A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.
|
||||
Project-URL: Changelog, https://platformdirs.readthedocs.io/en/latest/changelog.html
|
||||
Project-URL: Documentation, https://platformdirs.readthedocs.io
|
||||
Project-URL: Homepage, https://github.com/tox-dev/platformdirs
|
||||
Project-URL: Source, https://github.com/tox-dev/platformdirs
|
||||
Project-URL: Tracker, https://github.com/tox-dev/platformdirs/issues
|
||||
Maintainer-email: Bernát Gábor <gaborjbernat@gmail.com>, Julian Berman <Julian@GrayVines.com>, Ofek Lev <oss@ofek.dev>, Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
|
||||
License-Expression: MIT
|
||||
License-File: LICENSE
|
||||
Keywords: appdirs,application,cache,directory,log,user
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3 :: Only
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: 3.12
|
||||
Classifier: Programming Language :: Python :: 3.13
|
||||
Classifier: Programming Language :: Python :: 3.14
|
||||
Classifier: Programming Language :: Python :: Implementation :: CPython
|
||||
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||
Requires-Python: >=3.10
|
||||
Description-Content-Type: text/markdown
|
||||
|
||||
# platformdirs
|
||||
|
||||
[](https://badge.fury.io/py/platformdirs)
|
||||
[](https://pypi.python.org/pypi/platformdirs/)
|
||||
[](https://github.com/platformdirs/platformdirs/actions)
|
||||
[](https://pepy.tech/project/platformdirs)
|
||||
|
||||
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
|
||||
|
||||
```python
|
||||
from platformdirs import PlatformDirs
|
||||
|
||||
dirs = PlatformDirs("MyApp", "MyCompany")
|
||||
dirs.user_data_dir # ~/.local/share/MyApp (Linux)
|
||||
dirs.user_config_dir # ~/.config/MyApp (Linux)
|
||||
dirs.user_cache_dir # ~/.cache/MyApp (Linux)
|
||||
dirs.user_state_dir # ~/.local/state/MyApp (Linux)
|
||||
dirs.user_log_dir # ~/.local/state/MyApp/log (Linux)
|
||||
dirs.user_documents_dir # ~/Documents
|
||||
dirs.user_downloads_dir # ~/Downloads
|
||||
dirs.user_runtime_dir # /run/user/<uid>/MyApp (Linux)
|
||||
```
|
||||
|
||||
For Path objects instead of strings:
|
||||
|
||||
```python
|
||||
from platformdirs import PlatformDirs
|
||||
|
||||
dirs = PlatformDirs("MyApp", "MyCompany")
|
||||
dirs.user_data_path # pathlib.Path('~/.local/share/MyApp')
|
||||
dirs.user_config_path # pathlib.Path('~/.config/MyApp')
|
||||
```
|
||||
|
||||
Convenience functions for quick access:
|
||||
|
||||
```python
|
||||
from platformdirs import user_data_dir, user_config_path
|
||||
|
||||
user_data_dir("MyApp", "MyCompany") # returns str
|
||||
user_config_path("MyApp", "MyCompany") # returns pathlib.Path
|
||||
```
|
||||
|
||||
## Directory types
|
||||
|
||||
- **Data**: Persistent application data (`user_data_dir`, `site_data_dir`)
|
||||
- **Config**: Configuration files and settings (`user_config_dir`, `site_config_dir`)
|
||||
- **Cache**: Cached data that can be regenerated (`user_cache_dir`, `site_cache_dir`)
|
||||
- **State**: Non-essential runtime state like window positions (`user_state_dir`, `site_state_dir`)
|
||||
- **Logs**: Log files (`user_log_dir`, `site_log_dir`)
|
||||
- **Runtime**: Runtime files like sockets and PIDs (`user_runtime_dir`, `site_runtime_dir`)
|
||||
|
||||
Each type has both `user_*` (per-user, writable) and `site_*` (system-wide, read-only for users) variants.
|
||||
|
||||
## Documentation
|
||||
|
||||
Full documentation is available at [platformdirs.readthedocs.io](https://platformdirs.readthedocs.io):
|
||||
|
||||
- **[Getting started tutorial](https://platformdirs.readthedocs.io/en/latest/tutorial.html)** -- learn core concepts
|
||||
through real-world examples
|
||||
- **[How-to guides](https://platformdirs.readthedocs.io/en/latest/howto.html)** -- recipes for common tasks and
|
||||
platform-specific tips
|
||||
- **[API reference](https://platformdirs.readthedocs.io/en/latest/api.html)** -- complete list of functions and classes
|
||||
- **[Platform details](https://platformdirs.readthedocs.io/en/latest/platforms.html)** -- default paths for each
|
||||
operating system
|
||||
|
||||
Contributions are welcome! See [CONTRIBUTING.md](https://github.com/tox-dev/platformdirs/blob/main/CONTRIBUTING.md) for
|
||||
details.
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
platformdirs-4.9.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
platformdirs-4.9.4.dist-info/METADATA,sha256=Jl0ycpV78hiBFdFunnqwuP71goJfqOUuNL5odYuR3Xo,4683
|
||||
platformdirs-4.9.4.dist-info/RECORD,,
|
||||
platformdirs-4.9.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
||||
platformdirs-4.9.4.dist-info/licenses/LICENSE,sha256=KeD9YukphQ6G6yjD_czwzv30-pSHkBHP-z0NS-1tTbY,1089
|
||||
platformdirs/__init__.py,sha256=hL_ZyhsQ5EfYf4W_Tr4O6F0lAOKLvQi0TZ4e_WGCIc4,30718
|
||||
platformdirs/__main__.py,sha256=MvM6fKJpBAeiTZckNJGSihXFKkS46tS9_P5gySZg3RI,1633
|
||||
platformdirs/__pycache__/__init__.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/__main__.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/_xdg.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/android.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/api.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/macos.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/unix.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/version.cpython-310.pyc,,
|
||||
platformdirs/__pycache__/windows.cpython-310.pyc,,
|
||||
platformdirs/_xdg.py,sha256=zzf6nX5N329OzNe2PhFEFWAUhN7ijmghapDb81ll2Us,6457
|
||||
platformdirs/android.py,sha256=nbEJY4dyNjF-OM5RalA0WJIQHCUy8OKioGDS9G_-ZGg,10591
|
||||
platformdirs/api.py,sha256=iuNVDTrHntrQjBknqA-BSCsxWqix8aJugdYo4SbuBAo,12734
|
||||
platformdirs/macos.py,sha256=YP2C4B1krgWVSA7yOq1T6NrUqduZqaFXIUxVtB4FuEg,7869
|
||||
platformdirs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
platformdirs/unix.py,sha256=mcg5c1grrP1w566JAxDLSWtfq7L9qvS7foAr4b-IIrw,12189
|
||||
platformdirs/version.py,sha256=wnb6jtnQL3AvpQz2Kc9V7_5rRAT9pBykIPguVZgvo48,704
|
||||
platformdirs/windows.py,sha256=eQFkbOcRcI5YplmPx59FOd7yXJlhq27PpL7HVaC7se4,14564
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Wheel-Version: 1.0
|
||||
Generator: hatchling 1.29.0
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2010-202x The platformdirs developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Loading…
Add table
Add a link
Reference in a new issue