Cross-platform tool for adding locations to the user PATH, no sudo/runas required!
Project description
Ever wanted to release a cool new app but found it difficult to add its location to PATH for users? Me too! This tool does that for you on all major operating systems and does not require elevated privileges!
Fear not, this only modifies the user PATH; the system PATH is never touched nor even looked at!
Installation
userpath is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 2.6-2.7/3.3+ and PyPy.
$ pip install userpath
Commands
Only 3!
$ userpath -h
Usage: userpath [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
append Appends to the user PATH
prepend Prepends to the user PATH
verify Checks if locations are in the user PATH
API
>>> import userpath
>>> location = r'C:\Users\Ofek\Desktop\test'
>>>
>>> userpath.in_current_path(location)
False
>>> userpath.in_new_path(location)
False
>>> userpath.append(location)
True
>>> userpath.in_new_path(location)
True
>>> userpath.need_shell_restart(location)
True
License
userpath is distributed under the terms of both
at your option.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file userpath-1.0.0.tar.gz
.
File metadata
- Download URL: userpath-1.0.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd1a4d60920b608e58d7328df9f5ac0c9c61ab8658813670d1cf23f8fe0051e3 |
|
MD5 | 41db0167dd4c6512170439dd94dd5695 |
|
BLAKE2b-256 | 05d938df6812bc30c4973dc0048945f8692aa51ecf75040b7d5208818a59003f |
File details
Details for the file userpath-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: userpath-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6cfd9766bce164e3d3ae6854201d49c62494bca212e7527bf099b0aa043440c |
|
MD5 | 6e4d3fcdbce146d629d1aa93a77930ef |
|
BLAKE2b-256 | 83420d959aafc959fc3a02eaed8bd0287256063b68d4f02d35f7156aa0b65bb3 |