Library for fetching licenses and dependencies
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
licenselib-0.1.0.tar.gz
(7.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file licenselib-0.1.0.tar.gz.
File metadata
- Download URL: licenselib-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb48d04c14c8e3156f7fb7c3f68d3948fa787ef5f72c59a80bfe5805a8f4c49e
|
|
| MD5 |
b9939a5fbcc5fbf4682959decbd2b05e
|
|
| BLAKE2b-256 |
28c4d724d484b66976017ccbb8d574efe1dca925c2dbd8dc6642ff1d56be35a7
|
File details
Details for the file licenselib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: licenselib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fbd820c436fcc0cbaddec73559ec7a12b58d9ca8d29abbb674334a3fb709e52
|
|
| MD5 |
4b9f9149de927eb416246a2211dba3db
|
|
| BLAKE2b-256 |
40bc602c9630457072fce3ec591aa6fc35a0251efe85efbd95b63f83711021a9
|