pip-licenses-lib
Retrieve the software license list of Python packages installed with pip.
Decision gist · record as of 2026-08-14
Yes. Low install friction, no dependencies, active maintenance, and MIT licensing make it safe to add. Useful if you need programmatic license inspection. The setuptools >= 71 interaction is a known gotcha but documented and avoidable.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- If setuptools >= 71 is imported before this package, results may be inconsistent due to setuptools modifying sys.path.
- Low friction: zero runtime dependencies, pure Python wheel distribution.
License · maintenance · safety
MIT (permissive) — MIT license permits use, modification, and distribution with minimal restrictions. Permissive treatment means you can freely integrate this into commercial or proprietary projects.
last release 2026-05-07 (99 days) · last repo commit 2026-08-14 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 114,760 downloads/mo, #12,281 on PyPI
Alternatives
Verify before relying
pip install pip-licenses-lib
from pip_licenses_lib import get_packages
packages = get_packages()
for pkg in packages:
print(f"{pkg.name}: {pkg.license}")- Whether the package handles all modern license metadata standards beyond PEP 639
- Performance characteristics when scanning environments with many installed packages
- Accuracy of license detection for packages using non-standard license declaration methods
What it is and what it does
pip-licenses-lib is a programmatic library for querying the licenses of installed Python packages. It's a fork of the pip-licenses tool, refactored to expose license metadata as a library rather than just command-line output. The main entry point yields structured dataclass objects containing package name, version, license information, and copyright/notice file matches.
Unlike the original tool, this library removes all rendering and output formatting, exposes all methods at the top level for easier reuse, and adds support for newer standards like PEP 639. It returns both copyright and notice file matches, includes system packages, and offers options to skip file retrieval for faster version-only checks or to normalize package names. The package has no runtime dependencies and is actively maintained.
Use it for
- Generate a license inventory of all dependencies in a Python project for compliance auditing
- Automate license compliance checks in CI/CD pipelines to detect incompatible licenses before deployment
- Build internal tools that need programmatic access to installed package license metadata
- Audit which packages in an environment use specific licenses for legal review
- Create reports on copyright and notice files for all installed packages for distribution
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, no dependencies, active maintenance, and MIT licensing make it safe to add. Useful if you need programmatic license inspection. The setuptools >= 71 interaction is a known gotcha but documented and avoidable.
Install
pip-licenses-lib on PyPI
Before you install
Low friction: zero runtime dependencies, pure Python wheel distribution. Active maintenance with recent release (99 days ago) and current commit history. Requires Python 3.10 or later.
Requires Python 3.10 or later. If setuptools >= 71 is imported before this package, results may be inconsistent due to setuptools modifying sys.path.
License in practice
MIT license permits use, modification, and distribution with minimal restrictions. Permissive treatment means you can freely integrate this into commercial or proprietary projects.
Quickstart
pip install pip-licenses-lib
from pip_licenses_lib import get_packages
packages = get_packages()
for pkg in packages:
print(f"{pkg.name}: {pkg.license}")
Verify before relying
- Whether the package handles all modern license metadata standards beyond PEP 639
- Performance characteristics when scanning environments with many installed packages
- Accuracy of license detection for packages using non-standard license declaration methods
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 99 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 114,760 / month, #12,281 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyTopic :: Software DevelopmentTopic :: UtilitiesTyping :: Typed |
Evidence: pip_licenses_lib-1.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “inspect installed package licenses”
- pip-licenses-libProgrammatically retrieve and inspect the software licenses of Python…
- pip-licenses-cliA command-line tool that scans installed Python packages and reports…
- pipdeptreepipdeptree displays installed Python packages as a hierarchical…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also pip-licenses-cli · pip-licenses · licensecheck · snowflake-cli-labs · pip-audit · reuse · scripttest · importlib-metadata · pyone · all-packages