WinPath
WinPath is a python module for retrieving common Windows system paths as Unicode strings. It is especially useful in cases where the default path to a system file has been changed by the user. i.e When a user has changed the default path to their Documents folder.
WinPath is a fork of the original WinPaths
module by Ryan Ginstrom. It includes bug fixes for issues present in the
WinPaths
module and allows its inclusion in platform agnostic projects.
Installing
Install and update using pip:
pip install -U winpath
A Simple Example
WinPath can be imported and used within your own project like so.
The following example assumes that the user has chosen to sync their Documents directory with Onedrive.
import sys
import winpath
if sys.platform == "win32": # WinPath will only work on Windows
my_documents = winpath.get_my_documents()
print(my_documents) # C:\\Users\\username\\Onedrive\\Documents
Available Functions
-
get_local_appdata: Path to%LOCALAPPDATA% -
get_appdata: Path to%APPDATA% -
get_desktop: Path to the logged in user's desktop folder -
get_programs: current user -> Start menu -> Programs -
get_admin_tools: current user -> Start menu -> Programs -> Admin tools -
get_common_admin_tools: all users -> Start menu -> Programs -> Admin tools -
get_common_appdata: Path to program data folder -
get_common_documents: Path to public documents folder -
get_cookies: Path to internet explorer cookies folder -
get_history: Path to internet explorer history folder -
get_internet_cache: Path to internet explorer cache folder -
get_my_pictures: Path to the logged in user's pictures folder -
get_my_documents: Path to the logged in user's documents folder -
get_program_files: Path to Windows program files folder -
get_program_files_common: Path to Windows' program files -> common files folder -
get_system: Path to Windows' System32 folder -
get_windows: Path to Windows folder -
get_favorites: Path to the logged in user's favorites folder -
get_startup: current user -> start menu -> programs -> startup -
get_recent: Path to the logged in user's recently used files folder
License
This project is licensed under the terms of the MIT license.
Release files for winpath 202002.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| winpath-202002.2.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| winpath-202002.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / winpath-202002.2.tar.gz
| Download URL | winpath-202002.2.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49e588c47b0278083d42b8e50c8cec47810d26388fc6ea1ae1808d3589ce7c65
|
|
BLAKE2b-256 checksum How to use checksums |
1d8231716790b08e1ad201efb7a6a7dcd6d9f840a2dcc6e631a77afcd090d520
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.22.0
|
Release files / winpath-202002.2-py3-none-any.whl
| Download URL | winpath-202002.2-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4caded0a0c3304e54cf44b8a6a8e3d912c44e714634cda49a9432effe1608619
|
|
BLAKE2b-256 checksum How to use checksums |
e0bb58a5a1f2451bb204bc888d98868001882aede49c45e0fed8dc03f56fb163
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.22.0
|