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.3.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for adduserpath-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aac966b361850007c075dd5ac5349ce4b81c13fe5c686cd59443b655fa354473
MD5 7e0f0d791f06e4fd730e1ad1651a03fa
BLAKE2b-256 619e1d8f0401ee668b7645fbca865b2650789e97f6f7bf60534da32baf17b0cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adduserpath-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0f587af64eb3b22ec1dfd3522c17c3881d8c8d46793a92fceed36fa000547919
MD5 2177ac96ce840157f114be218aace680
BLAKE2b-256 a1ca459e43b7571a69301097c0025682457da8c1da66e201551b378c58e98c3c

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