Registry / devops / pip-licenses-lib

pip-licenses-lib

JSON →
library1.2.2pypypi✓ verified 84d ago

A library to retrieve the software license list of Python packages installed with pip. Provides programmatic access to license metadata, with support for PEP 639, PEP 770, and SBOM files. Current version 1.1.0, requires Python >=3.10, released approximately every few months.

pip install pip-licenses-lib
INSTALL
IMPORT
SIG · PIP-LICENSES-LIB
P
pip-licenses-lib
devopspythonv1.2.2
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_packages
from piplicenses_lib import get_packages
from pip_licenses_lib import get_packages

Retrieve license info for all installed packages and print first 5 (name, license expression, version).

from pip_licenses_lib import get_packages packages = get_packages() for pkg in packages[:5]: print(pkg.name, pkg.license_expression, pkg.version)
Debug
Known issues
breakingIn v0.3.0, the return type changed from dict to dataclass (Package). Attribute names were renamed to match PEP8. Code accessing dict keys or old attribute names will break.
fix
Upgrade to >=0.3.0 and use object attributes (e.g., pkg.name, pkg.version) instead of dictionary subscripting.
affects: <0.3.0
gotchaPackage model is not importable from the top-level; must import from pip_licenses_lib.models.Package. Doing from pip_licenses_lib import Package raises ImportError.
fix
Use from pip_licenses_lib.models import Package.
affects: >=0.3.0
deprecatedPython <=3.9 support dropped in v0.5.0; Python <=3.9 dropped again in v1.0.0 (now requires >=3.10).
fix
Upgrade Python to >=3.10 for latest version.
affects: <0.5.0, 0.5.0-0.6.0 require >=3.9, <1.0.0 requires >=3.9, >=1.0.0 requires >=3.10
Upgrade
Version history
1.2.2latest on PyPI · released May 7, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
pip-licenses-lib — pip install pip-licenses-lib · libregistry