The userfolders module provides cross-platform access to a user's special folders (or directories) like My Documents, Desktop, and Application Data. It is primarily intended to simplify development of desktop application software.
A quick usage example:
# Get the user's My Documents folder
import userfolders
my_docs = userfolders.get_my_documents()
Both Windows and Unix platforms are supported (untested on Mac, currently accepting contributions).
Fork Notice
This project is a fork of Benjamin Johnson's userpaths with enhanced Linux Support and modern Python features.
API Reference
| Function | Description |
|---|---|
get_appdata() |
Return the current user's roaming Application Data folder. |
get_desktop() |
Return the current user's Desktop folder. |
get_downloads() |
Return the current user's Downloads folder. |
get_local_appdata() |
Return the current user's local Application Data folder. |
get_my_documents() |
Return the current user's My Documents folder. |
get_my_music() |
Return the current user's My Music folder. |
get_my_pictures() |
Return the current user's My Pictures folder. |
get_my_videos() |
Return the current user's My Videos folder. |
get_profile() |
Return the current user's profile folder. |
The userfolders API was inspired by, and is partly compatible with, Ryan Ginstrom's winpaths. However, userfolders is not intended as a direct replacement for that module.
Compatibility Note
The userfolders module was originally designed from a Windows-centric perspective. Because of the many differences between the two systems, there are some Windows paths that do not have a direct equivalent on Unix, and vice versa. In these cases, userfolders attempts to return the nearest functional equivalent, but it is up to the user to ensure their application is using the appropriate path for what it seeks to do.
Metadata
Release files for userfolders 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| userfolders-0.2.0.tar.gz | 6.1 kB | Without provenance | Details for userfolders-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| userfolders-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for userfolders-0.2.0-py3-none-any.whl |
Total release size: 13.5 kB
Release files / userfolders-0.2.0.tar.gz
| Download URL | userfolders-0.2.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df8777d47ff34a5e34bc10bc6c3a9bbe62c837c6daac27631958a4fa67189ed6
|
|
BLAKE2b-256 checksum How to use checksums |
3e98e056ab80083921ec84fcc538c4164aedac3add7527b5650b8a266405ebdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / userfolders-0.2.0-py3-none-any.whl
| Download URL | userfolders-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
927f73ec440a1b8a7f8299146294edb9267471c5c6a3e1bccaa42ecdddf301d4
|
|
BLAKE2b-256 checksum How to use checksums |
b4c70ddfc32a53a131ffcff81447f4c2ae973c662d8c736832fa22637c304841
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for userfolders 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.