Skip to main content

Cross-platform tool for adding locations to the user PATH, no elevated privileges required!

Project description

CI - Travis CI - AppVeyor Codecov

PyPI - Supported Python versions PyPI - Version PyPI - Downloads

License: MIT/Apache-2.0 Say Thanks

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.7/3.6+ 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.

History

Important changes are emphasized.

1.3.0

  • Only require the dependency distro on Linux

  • Ship tests with source distributions

1.2.0

  • Added support for shell auto-detection and selection

1.1.0

  • First public stable release

View all history

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

Uploaded Source

Built Distribution

userpath-1.3.0-py2.py3-none-any.whl (14.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: userpath-1.3.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for userpath-1.3.0.tar.gz
Algorithm Hash digest
SHA256 dd0b8ba650732c614c5e6b709e51be321c596566422d99a443d545401a965468
MD5 8232c40700bcd0ecf56d8617d1372a7e
BLAKE2b-256 205c5a59dabbe0bb09549243fa649718fa206167437ec48b4cb4c715ec018c7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: userpath-1.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for userpath-1.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 914fe0e8c517bedf4ad36d14c6089e2a8b64fb21a50a8126352eca30a805511e
MD5 3928c6f9c3a1680abd3879f484b0fef9
BLAKE2b-256 8a7207927efb668a0aa0cef502dbe4da442ac9598f19344bca9a3eb9bd062ec1

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