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
adduserpath 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 adduserpath
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 a location is 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 adduserpath-0.2.0.tar.gz
.
File metadata
- Download URL: adduserpath-0.2.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14695a038d9e4d3bb104d8e43844834d90c62126c3837959380c881254894d3c |
|
MD5 | 5fa2ea7202a565396bc90f029faeb2d4 |
|
BLAKE2b-256 | 03a77a42e1e5c5f621696a38e5047c3b6dd2dbd9675e73f193a089ee71393a55 |
File details
Details for the file adduserpath-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: adduserpath-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f5dae97f4ba0a2c29d24c0675da5192affd074a6e1c34de4b669d639e563f02 |
|
MD5 | bc3cb43e4a5eb56bf09810dec515965e |
|
BLAKE2b-256 | b87915c55e0d76aaaceccd247311e36c1fbdfd0c30212f60fe0089cd7553a203 |