A Python package for manipulating the PATH
environment variable.
pip install pathenv
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()
- 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.
from pathenv import add_to_path
add_to_path("/usr/local/bin")
from pathenv import remove_from_path
remove_from_path("/usr/local/bin")
from pathenv import refresh_path
refresh_path()
For more detailed documentation, please refer to the API documentation.
pathenv
is released under the GNU General Public License v2.0.