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

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

adduserpath-0.4.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

adduserpath-0.4.0-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file adduserpath-0.4.0.tar.gz.

File metadata

  • Download URL: adduserpath-0.4.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for adduserpath-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d12612a529028a2bda79f5111eab6ba4b787625b3fd8958f47ac9371ea9a76dc
MD5 cb1cf1377ed08f19ceecea93bf556a07
BLAKE2b-256 adcb50f2be266f19130308cd705a3556f1d06220a5ca60a446c496a485b12726

See more details on using hashes here.

File details

Details for the file adduserpath-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for adduserpath-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3494c0a58b8792c05feccfc3a4d3aee6b02ce469dab33798b4eae7622f631d7d
MD5 6f7be9ef96db27c847f8325ba20a0cb5
BLAKE2b-256 e8533035ff330183156e93295f5e83735ae1626ad38e215fdf837fe20ba0fab0

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