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_to_path("/path/to/new/directory")
remove_from_path("/path/to/old/directory")
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.