Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pathenv

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pathenv

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

  • 1.5
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc