pip-api is an unofficial Python library providing a programmatic interface to pip's functionality. It allows developers to inspect installed packages, run pip commands, and manage package metadata directly from Python code. The current version is 0.0.34. Due to its nature of wrapping pip's internal APIs, its release cadence is closely tied to pip's updates and internal changes.
pip install pip-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to list currently installed packages and how to execute a basic `pip` command using `pip-api`.
Upgrade to Python 3.8 or newer, or pin `pip-api<0.0.34`.
Monitor `pip-api` releases for compatibility with new `pip` versions and thoroughly test your application after `pip` or `pip-api` upgrades.
Exercise caution when using `pip_api.run()` with commands that modify the environment. Consider running in isolated or virtual environments for sensitive operations.
Cache the result of `installed_packages()` if you need to access package information multiple times within a short period or in performance-sensitive sections of your code.
No dependency data recorded yet.