Skip to main content

A small module to read the information written by pip-licenses.

Project description

pip-licenses-reader

The pip-licenses-reader provides a simple reader for JSON files generated by pip-licenses.

Setting up the data

Create a file called bill_of_materials.json using the following command:

  pip-licenses --format=json --output-file=bill_of_materials.json --with-authors --with-urls

and place it next to your start-up script.

NOTE: If you use another file name or location, the file path must set at run-time.

Usage

from pip_licenses_reader import read_file

license_collection = read_file()

The resulting element will be read-only. It provides a value called projects, which is iterable. For each item, the following properties are set:

  • author
  • name
  • url
  • version (as packaging.version.Version from setuptools or packaging)
  • license

Hence, the data can be considered as bill of materials for your project, if it was created from a virtual env.

If you used another file path or name, this can be passed as the first argument called file.

Errors will be logged using the a regular Logger from pythons logging module.

License

This project is licensed under the BSD-3-Clause license.

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

pip-licenses-reader-0.9.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

pip_licenses_reader-0.9.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pip-licenses-reader-0.9.0.tar.gz.

File metadata

  • Download URL: pip-licenses-reader-0.9.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pip-licenses-reader-0.9.0.tar.gz
Algorithm Hash digest
SHA256 b3135f2121dc418d1f47fa13917a1eb7a04a249b6e5960251f914efdcc37bb62
MD5 adaf4554447f9187b769d5ad2bb90385
BLAKE2b-256 fdf5597e3e69ee5c2f918ac9a72377e3de044ceb6fb02f619894b42d85cda9ee

See more details on using hashes here.

File details

Details for the file pip_licenses_reader-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pip_licenses_reader-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pip_licenses_reader-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7514eb0780612348975ee0f52f58c0dc0479bce86512362224e2351cfeb2c913
MD5 3ec5f0cb66f264aeffa9eaf68cc1d361
BLAKE2b-256 fe4f3e9a10ff1d5bc4e494b0915a93585cf426e5b01e9ae538f35c353366cbd2

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