LicenseLib
Library for fetching licenses and dependencies.
Install
python3 -m pip install --user licenselib
Usage
Retrieve package info from PyPI:
from licenselib import pypi, License
pkg = pypi.get_package('licenselib')
print(pkg) # all pkg data
dependencies = pkg.dependencies
print(dependencies) # pkg dependencies as list including version
# for locally installed packages you may use:
license: License = get_local_licenses(['requests'])[0]
print(license) # license metadata
print(license.licensetext) # full licensetext
# for remote packages you could use: (note: this will install the package temporarily though!)
license: License = get_licenses_unsafe(['django'])[0]
print(license)
print(license.licensetext)
Retrieve packages from GitHub
from licenselib import github, License
# get github repo
repo = github.get_repo(owner='django', name='django') # like this
repo = github.get_repo(url='https://github.com/django/django') # or like this
dependencies = repo.dependencies
print(dependencies) # repo dependencies
print(dependency.name for dependency in repo.dependencies) # repo dependencies names as list
# get license
license: License = repo.license
print(license)
print(license.licensetext)
# or get even more data
license_data = repo.get_license()
print(license_data) # all license data
Metadata
Release files for licenselib 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| licenselib-1.0.0.tar.gz | 7.4 kB | Without provenance | Details for licenselib-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| licenselib-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for licenselib-1.0.0-py3-none-any.whl |
Total release size: 16.1 kB
Release files / licenselib-1.0.0.tar.gz
| Download URL | licenselib-1.0.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24e5210552bb726b50c8fb432b5e20b2204903bf09505ef2a615136d38068c24
|
|
BLAKE2b-256 checksum How to use checksums |
7193beec784093bc677747404839527443e967d71fbb2e802cfd9b9a3e4b2d20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / licenselib-1.0.0-py3-none-any.whl
| Download URL | licenselib-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
825d1d30a9b0112fd3bf8a0039b326d5e363f45481d9804ce11d654cba4972ac
|
|
BLAKE2b-256 checksum How to use checksums |
d023ed5c27c8a0a99b5e6aaf5f1719bdf711b424e6b49dd10c0872340ac91bbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for licenselib 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.