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
  • 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.8.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pip_licenses_reader-0.8.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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