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

  • Modify bash start-up files based on their existence

  • Remove distro dependency

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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: userpath-1.5.0.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.5.0.tar.gz
Algorithm Hash digest
SHA256 61f84899b7280800a8b6cc1b959a0cf250f6757e6f6c7176d7455bb693a4423a
MD5 f131e6e5c249f693ff5cc9553a446689
BLAKE2b-256 ab31bd1b5d1129c14ed064b3ac557e8025a02d3ae6503f8afd4118e8f929f639

See more details on using hashes here.

File details

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

File metadata

  • Download URL: userpath-1.5.0-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.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c6a5b42e454f5e88d54af035fe3756de33a5318ad65a4191bb64e6b7cac03bcc
MD5 2c3091dbb04809b7c0377e1445043337
BLAKE2b-256 26f6d5e99fe900a0a0969538514be4dda0ce6b42c200b538edfd5a167da2d483

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