]> crepu.dev Git - config.git/blame - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/platformdirs-3.11.0.dist-info/METADATA
Actualización de Readme
[config.git] / djavu-asus / elpy / rpc-venv / lib / python3.11 / site-packages / platformdirs-3.11.0.dist-info / METADATA
CommitLineData
53e6db90
DC
1Metadata-Version: 2.1
2Name: platformdirs
3Version: 3.11.0
4Summary: A small Python package for determining appropriate platform-specific dirs, e.g. a "user data dir".
5Project-URL: Documentation, https://platformdirs.readthedocs.io
6Project-URL: Homepage, https://github.com/platformdirs/platformdirs
7Project-URL: Source, https://github.com/platformdirs/platformdirs
8Project-URL: Tracker, https://github.com/platformdirs/platformdirs/issues
9Maintainer-email: Bernát Gábor <gaborjbernat@gmail.com>, Julian Berman <Julian@GrayVines.com>, Ofek Lev <oss@ofek.dev>, Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
10License-Expression: MIT
11License-File: LICENSE
12Keywords: appdirs,application,cache,directory,log,user
13Classifier: Development Status :: 5 - Production/Stable
14Classifier: Intended Audience :: Developers
15Classifier: License :: OSI Approved :: MIT License
16Classifier: Operating System :: OS Independent
17Classifier: Programming Language :: Python
18Classifier: Programming Language :: Python :: 3 :: Only
19Classifier: Programming Language :: Python :: 3.7
20Classifier: Programming Language :: Python :: 3.8
21Classifier: Programming Language :: Python :: 3.9
22Classifier: Programming Language :: Python :: 3.10
23Classifier: Programming Language :: Python :: 3.11
24Classifier: Programming Language :: Python :: 3.12
25Classifier: Programming Language :: Python :: Implementation :: CPython
26Classifier: Programming Language :: Python :: Implementation :: PyPy
27Classifier: Topic :: Software Development :: Libraries :: Python Modules
28Requires-Python: >=3.7
29Requires-Dist: typing-extensions>=4.7.1; python_version < '3.8'
30Provides-Extra: docs
31Requires-Dist: furo>=2023.7.26; extra == 'docs'
32Requires-Dist: proselint>=0.13; extra == 'docs'
33Requires-Dist: sphinx-autodoc-typehints>=1.24; extra == 'docs'
34Requires-Dist: sphinx>=7.1.1; extra == 'docs'
35Provides-Extra: test
36Requires-Dist: appdirs==1.4.4; extra == 'test'
37Requires-Dist: covdefaults>=2.3; extra == 'test'
38Requires-Dist: pytest-cov>=4.1; extra == 'test'
39Requires-Dist: pytest-mock>=3.11.1; extra == 'test'
40Requires-Dist: pytest>=7.4; extra == 'test'
41Description-Content-Type: text/x-rst
42
43The problem
44===========
45
46.. image:: https://github.com/platformdirs/platformdirs/actions/workflows/check.yml/badge.svg
47 :target: https://github.com/platformdirs/platformdirs/actions
48
49When writing desktop application, finding the right location to store user data
50and configuration varies per platform. Even for single-platform apps, there
51may by plenty of nuances in figuring out the right location.
52
53For example, if running on macOS, you should use::
54
55 ~/Library/Application Support/<AppName>
56
57If on Windows (at least English Win) that should be::
58
59 C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\<AppName>
60
61or possibly::
62
63 C:\Documents and Settings\<User>\Application Data\<AppAuthor>\<AppName>
64
65for `roaming profiles <https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc766489(v=ws.10)>`_ but that is another story.
66
67On Linux (and other Unices), according to the `XDG Basedir Spec`_, it should be::
68
69 ~/.local/share/<AppName>
70
71.. _XDG Basedir Spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
72
73``platformdirs`` to the rescue
74==============================
75
76This kind of thing is what the ``platformdirs`` package is for.
77``platformdirs`` will help you choose an appropriate:
78
79- user data dir (``user_data_dir``)
80- user config dir (``user_config_dir``)
81- user cache dir (``user_cache_dir``)
82- site data dir (``site_data_dir``)
83- site config dir (``site_config_dir``)
84- user log dir (``user_log_dir``)
85- user documents dir (``user_documents_dir``)
86- user downloads dir (``user_downloads_dir``)
87- user pictures dir (``user_pictures_dir``)
88- user videos dir (``user_videos_dir``)
89- user music dir (``user_music_dir``)
90- user desktop dir (``user_desktop_dir``)
91- user runtime dir (``user_runtime_dir``)
92
93And also:
94
95- Is slightly opinionated on the directory names used. Look for "OPINION" in
96 documentation and code for when an opinion is being applied.
97
98Example output
99==============
100
101On macOS:
102
103.. code-block:: pycon
104
105 >>> from platformdirs import *
106 >>> appname = "SuperApp"
107 >>> appauthor = "Acme"
108 >>> user_data_dir(appname, appauthor)
109 '/Users/trentm/Library/Application Support/SuperApp'
110 >>> site_data_dir(appname, appauthor)
111 '/Library/Application Support/SuperApp'
112 >>> user_cache_dir(appname, appauthor)
113 '/Users/trentm/Library/Caches/SuperApp'
114 >>> user_log_dir(appname, appauthor)
115 '/Users/trentm/Library/Logs/SuperApp'
116 >>> user_documents_dir()
117 '/Users/trentm/Documents'
118 >>> user_downloads_dir()
119 '/Users/trentm/Downloads'
120 >>> user_pictures_dir()
121 '/Users/trentm/Pictures'
122 >>> user_videos_dir()
123 '/Users/trentm/Movies'
124 >>> user_music_dir()
125 '/Users/trentm/Music'
126 >>> user_desktop_dir()
127 '/Users/trentm/Desktop'
128 >>> user_runtime_dir(appname, appauthor)
129 '/Users/trentm/Library/Caches/TemporaryItems/SuperApp'
130
131On Windows:
132
133.. code-block:: pycon
134
135 >>> from platformdirs import *
136 >>> appname = "SuperApp"
137 >>> appauthor = "Acme"
138 >>> user_data_dir(appname, appauthor)
139 'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp'
140 >>> user_data_dir(appname, appauthor, roaming=True)
141 'C:\\Users\\trentm\\AppData\\Roaming\\Acme\\SuperApp'
142 >>> user_cache_dir(appname, appauthor)
143 'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Cache'
144 >>> user_log_dir(appname, appauthor)
145 'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Logs'
146 >>> user_documents_dir()
147 'C:\\Users\\trentm\\Documents'
148 >>> user_downloads_dir()
149 'C:\\Users\\trentm\\Downloads'
150 >>> user_pictures_dir()
151 'C:\\Users\\trentm\\Pictures'
152 >>> user_videos_dir()
153 'C:\\Users\\trentm\\Videos'
154 >>> user_music_dir()
155 'C:\\Users\\trentm\\Music'
156 >>> user_desktop_dir()
157 'C:\\Users\\trentm\\Desktop'
158 >>> user_runtime_dir(appname, appauthor)
159 'C:\\Users\\trentm\\AppData\\Local\\Temp\\Acme\\SuperApp'
160
161On Linux:
162
163.. code-block:: pycon
164
165 >>> from platformdirs import *
166 >>> appname = "SuperApp"
167 >>> appauthor = "Acme"
168 >>> user_data_dir(appname, appauthor)
169 '/home/trentm/.local/share/SuperApp'
170 >>> site_data_dir(appname, appauthor)
171 '/usr/local/share/SuperApp'
172 >>> site_data_dir(appname, appauthor, multipath=True)
173 '/usr/local/share/SuperApp:/usr/share/SuperApp'
174 >>> user_cache_dir(appname, appauthor)
175 '/home/trentm/.cache/SuperApp'
176 >>> user_log_dir(appname, appauthor)
177 '/home/trentm/.cache/SuperApp/log'
178 >>> user_config_dir(appname)
179 '/home/trentm/.config/SuperApp'
180 >>> user_documents_dir()
181 '/home/trentm/Documents'
182 >>> user_downloads_dir()
183 '/home/trentm/Downloads'
184 >>> user_pictures_dir()
185 '/home/trentm/Pictures'
186 >>> user_videos_dir()
187 '/home/trentm/Videos'
188 >>> user_music_dir()
189 '/home/trentm/Music'
190 >>> user_desktop_dir()
191 '/home/trentm/Desktop'
192 >>> user_runtime_dir(appname, appauthor)
193 '/run/user/{os.getuid()}/SuperApp'
194 >>> site_config_dir(appname)
195 '/etc/xdg/SuperApp'
196 >>> os.environ["XDG_CONFIG_DIRS"] = "/etc:/usr/local/etc"
197 >>> site_config_dir(appname, multipath=True)
198 '/etc/SuperApp:/usr/local/etc/SuperApp'
199
200On Android::
201
202 >>> from platformdirs import *
203 >>> appname = "SuperApp"
204 >>> appauthor = "Acme"
205 >>> user_data_dir(appname, appauthor)
206 '/data/data/com.myApp/files/SuperApp'
207 >>> user_cache_dir(appname, appauthor)
208 '/data/data/com.myApp/cache/SuperApp'
209 >>> user_log_dir(appname, appauthor)
210 '/data/data/com.myApp/cache/SuperApp/log'
211 >>> user_config_dir(appname)
212 '/data/data/com.myApp/shared_prefs/SuperApp'
213 >>> user_documents_dir()
214 '/storage/emulated/0/Documents'
215 >>> user_downloads_dir()
216 '/storage/emulated/0/Downloads'
217 >>> user_pictures_dir()
218 '/storage/emulated/0/Pictures'
219 >>> user_videos_dir()
220 '/storage/emulated/0/DCIM/Camera'
221 >>> user_music_dir()
222 '/storage/emulated/0/Music'
223 >>> user_desktop_dir()
224 '/storage/emulated/0/Desktop'
225 >>> user_runtime_dir(appname, appauthor)
226 '/data/data/com.myApp/cache/SuperApp/tmp'
227
228Note: Some android apps like Termux and Pydroid are used as shells. These
229apps are used by the end user to emulate Linux environment. Presence of
230``SHELL`` environment variable is used by Platformdirs to differentiate
231between general android apps and android apps used as shells. Shell android
232apps also support ``XDG_*`` environment variables.
233
234
235``PlatformDirs`` for convenience
236================================
237
238.. code-block:: pycon
239
240 >>> from platformdirs import PlatformDirs
241 >>> dirs = PlatformDirs("SuperApp", "Acme")
242 >>> dirs.user_data_dir
243 '/Users/trentm/Library/Application Support/SuperApp'
244 >>> dirs.site_data_dir
245 '/Library/Application Support/SuperApp'
246 >>> dirs.user_cache_dir
247 '/Users/trentm/Library/Caches/SuperApp'
248 >>> dirs.user_log_dir
249 '/Users/trentm/Library/Logs/SuperApp'
250 >>> dirs.user_documents_dir
251 '/Users/trentm/Documents'
252 >>> dirs.user_downloads_dir
253 '/Users/trentm/Downloads'
254 >>> dirs.user_pictures_dir
255 '/Users/trentm/Pictures'
256 >>> dirs.user_videos_dir
257 '/Users/trentm/Movies'
258 >>> dirs.user_music_dir
259 '/Users/trentm/Music'
260 >>> dirs.user_desktop_dir
261 '/Users/trentm/Desktop'
262 >>> dirs.user_runtime_dir
263 '/Users/trentm/Library/Caches/TemporaryItems/SuperApp'
264
265Per-version isolation
266=====================
267
268If you have multiple versions of your app in use that you want to be
269able to run side-by-side, then you may want version-isolation for these
270dirs::
271
272 >>> from platformdirs import PlatformDirs
273 >>> dirs = PlatformDirs("SuperApp", "Acme", version="1.0")
274 >>> dirs.user_data_dir
275 '/Users/trentm/Library/Application Support/SuperApp/1.0'
276 >>> dirs.site_data_dir
277 '/Library/Application Support/SuperApp/1.0'
278 >>> dirs.user_cache_dir
279 '/Users/trentm/Library/Caches/SuperApp/1.0'
280 >>> dirs.user_log_dir
281 '/Users/trentm/Library/Logs/SuperApp/1.0'
282 >>> dirs.user_documents_dir
283 '/Users/trentm/Documents'
284 >>> dirs.user_downloads_dir
285 '/Users/trentm/Downloads'
286 >>> dirs.user_pictures_dir
287 '/Users/trentm/Pictures'
288 >>> dirs.user_videos_dir
289 '/Users/trentm/Movies'
290 >>> dirs.user_music_dir
291 '/Users/trentm/Music'
292 >>> dirs.user_desktop_dir
293 '/Users/trentm/Desktop'
294 >>> dirs.user_runtime_dir
295 '/Users/trentm/Library/Caches/TemporaryItems/SuperApp/1.0'
296
297Be wary of using this for configuration files though; you'll need to handle
298migrating configuration files manually.
299
300Why this Fork?
301==============
302
303This repository is a friendly fork of the wonderful work started by
304`ActiveState <https://github.com/ActiveState/appdirs>`_ who created
305``appdirs``, this package's ancestor.
306
307Maintaining an open source project is no easy task, particularly
308from within an organization, and the Python community is indebted
309to ``appdirs`` (and to Trent Mick and Jeff Rouse in particular) for
310creating an incredibly useful simple module, as evidenced by the wide
311number of users it has attracted over the years.
312
313Nonetheless, given the number of long-standing open issues
314and pull requests, and no clear path towards `ensuring
315that maintenance of the package would continue or grow
316<https://github.com/ActiveState/appdirs/issues/79>`_, this fork was
317created.
318
319Contributions are most welcome.