--- id: pip-licenses-lib version: "1.2.2" license: MIT license_treatment: permissive maintenance: active --- # pip-licenses-lib — Retrieve the software license list of Python packages installed with pip. License: permissive · Maintenance: active · Downloads: 114.8K/mo ## 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 above — verify before relying. Programmatically retrieve and inspect the software licenses of Python packages installed in your environment, returning structured package metadata including license information. 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 install pip-licenses-lib uv add pip-licenses-lib poetry add pip-licenses-lib ## Installing pip-licenses-lib 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. 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}") Requires Python 3.10 or later. If setuptools >= 71 is imported before this package, results may be inconsistent due to setuptools modifying sys.path. 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_current - Install friction: low - Maintenance: active - Downloads: 114.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python package license detection, inspect installed package licenses, get pip package license info, license compliance checking, package metadata retrieval, software license inventory, dependency license audit, license-compliance, dependency-audit, metadata-extraction [View on SkillFed](https://skillfed.io/packages/pip-licenses-lib) · [View on PyPI](https://pypi.org/project/pip-licenses-lib/)