Skip to main content

Library for fetching licenses and dependencies

Project description

LicenseLib

Python

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

licenselib-1.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

licenselib-1.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file licenselib-1.0.0.tar.gz.

File metadata

  • Download URL: licenselib-1.0.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

Hashes for licenselib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 24e5210552bb726b50c8fb432b5e20b2204903bf09505ef2a615136d38068c24
MD5 49c1436585e1efe8bc57684f73095c39
BLAKE2b-256 7193beec784093bc677747404839527443e967d71fbb2e802cfd9b9a3e4b2d20

See more details on using hashes here.

File details

Details for the file licenselib-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: licenselib-1.0.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

Hashes for licenselib-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 825d1d30a9b0112fd3bf8a0039b326d5e363f45481d9804ce11d654cba4972ac
MD5 c0c22c20de4ad31851f814dc3bfdfd44
BLAKE2b-256 d023ed5c27c8a0a99b5e6aaf5f1719bdf711b424e6b49dd10c0872340ac91bbb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page