Cross-platform access to a user's special folders
Project description
The userpaths 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 userpaths
my_docs = userpaths.get_my_documents()
Both Python 2 and 3 are supported, on Windows and Unix platforms.
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 userpaths API was inspired by, and is partly compatible with, Ryan Ginstrom's winpaths. However, userpaths is not intended as a direct replacement for that module.
Compatibility Note
The userpaths 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, userpaths 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.
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
Built Distribution
Hashes for userpaths-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03c682b3fbb80d11c24d53b700dcb3f7b1bfab8abff267f3845fbfbaa69b4c8e |
|
MD5 | 879b02ccfd94242ea6fc08f7d367bf16 |
|
BLAKE2b-256 | 4ef519da5175554edd7c7db2de18ea11023b7e7cfdacf3a7a9484d3a37ab174c |