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

  • Fix fallback mechanism for detecting the name of the parent process

1.4.1

  • Fix PATH registry key type on Windows

1.4.0

  • Fix duplicating system paths on Windows

  • Prevent adding paths multiple times on macOS/Linux

  • Send CLI errors to stderr instead of stdout

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

Uploaded Source

Built Distribution

userpath-1.4.2-py2.py3-none-any.whl (14.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: userpath-1.4.2.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for userpath-1.4.2.tar.gz
Algorithm Hash digest
SHA256 dd4b5496e4ef2c1a3bbb103ffefa7738fa4ba15f23580918bb9f949dcd61a8a7
MD5 48bd9e7712dd953b9337a69bde9338c8
BLAKE2b-256 f01bd2bccd0b855484e3b419c0d87990e6f588793fb7b233d8ea26fa620936fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: userpath-1.4.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for userpath-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 98e0c1a5df626589724b4911b0bebf9bfd8dc88f98db4994db0e405c4f8b638b
MD5 0f59542b3f56e2a0912c1065f759ba44
BLAKE2b-256 e8068f78233ebf810c92405c4ec4245bd7d89e6f87dfbd9cce7add5359390ed3

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