Skip to main content

One of the best Python package to manipulate the `PATH` environment variable

Project description

pathenv

A Python package for manipulating the PATH environment variable.

Installation

pip install pathenv

Usage

from pathenv import add_to_path, remove_from_path, refresh_path

# Add a new directory to the PATH
add_to_path("/path/to/new/directory")

# Remove a directory from the PATH
remove_from_path("/path/to/old/directory")

# Refresh the PATH
refresh_path()

Features

  • Cross-platform: Works on Windows, Linux, and macOS.
  • Simple API: Easy to use with a few functions.
  • Safe: Doesn't modify the system PATH without your consent.
  • Well-tested: Thoroughly tested for reliability.

Examples

Add a directory to the PATH

from pathenv import add_to_path

add_to_path("/usr/local/bin")

Remove a directory from the PATH

from pathenv import remove_from_path

remove_from_path("/usr/local/bin")

Refresh the PATH

from pathenv import refresh_path

refresh_path()

Documentation

For more detailed documentation, please refer to the API documentation.

License

pathenv is released under the GNU General Public License v2.0.

Project details


Release history Release notifications | RSS feed

This version

1.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathenv-1.5.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

pathenv-1.5-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file pathenv-1.5.tar.gz.

File metadata

  • Download URL: pathenv-1.5.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pathenv-1.5.tar.gz
Algorithm Hash digest
SHA256 7c0727166f537ab45133be62cba9007f0ed1f3a2a2cde811ce2d599c21df1916
MD5 a5919831f8c8dd3036e57d6f4530c4f9
BLAKE2b-256 98f450fc356ca41644b086da8c16154a4b80783d442cb2d3ba17813eaee5de29

See more details on using hashes here.

File details

Details for the file pathenv-1.5-py3-none-any.whl.

File metadata

  • Download URL: pathenv-1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pathenv-1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 23a5c6f5f895f1193b92f0709d2b4ac91612b78f5d52f7fffad0d6afd0033975
MD5 ff24e477c813454a320eb0b7111ff243
BLAKE2b-256 1bca8bfde4d647f805aed4b98d35ad7cec845cb606339e497867e7b12bcc478c

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