Skip to main content

Cross-platform tool for adding locations to the user PATH, no sudo/runas required!

Project description

Latest PyPI version Travis CI AppVeyor CI Supported Python versions License

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
Example run

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

userpath-1.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

userpath-1.1.0-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file userpath-1.1.0.tar.gz.

File metadata

  • Download URL: userpath-1.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for userpath-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c4aa4b20298d14272e2a39047a38a7e2195c1d697dd37dec247e2331067e7f31
MD5 2b5f61e9a28e0cdf3a66c136d73563a6
BLAKE2b-256 247b3b991e87d08211a95bafcadc370cb17e75a7dfb51e6f9ce9247f8cfff4c0

See more details on using hashes here.

File details

Details for the file userpath-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for userpath-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a32b79fe56a8a6c3785c42053a951fe2e8b658688752d867fb6f3c1c22810e27
MD5 43f1cec0886b2886d3ac23d653e19280
BLAKE2b-256 238cbe43c12d4a78247491bf39f223d5f9e88312adb220e9f22a4cda6e478137

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page