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!
userpath is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 2.7/3.6+ and PyPy.
$ pip install userpath
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
>>> 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
userpath is distributed under the terms of both
at your option.
Important changes are emphasized.
- Added support for shell auto-detection and selection
- First public stable release
View all history