Skip to main content

PyLicense

PyLicense is a CLI tool that queries license information from one of the following package repositories: PyPI, Anaconda or conda-forge.

PyLicense uses the online information of those repositories, e.g. the license information that is listed on pypi.org/pypi/<packagename>, e.g. https://pypi.org/project/dcs-pylicense/. While this means that the package must not be installed on the local system, it also shows information about the lastest package version and not every possible package version.

Installation

To install the package run

$ pip install dcs-pylicense

The tool registers itself as pylicense. To learn about the available arguments refer to its help:

$ pylicense --help

Usage

PyLicense requires a file in the format of a requirements file. The format is described here.

To query license information of the packages run

$ pylicense path/to/my/requirements.txt
| name       | license   | version   |
|:-----------|:----------|:----------|
| black      | MIT       | 20.8b1    |
| pylint     | GPL       | 2.6.0     |
| pytest     | MIT       | 6.0.2     |
| pytest-cov | MIT       | 2.10.1    |
| sphinx     | BSD       | 3.2.1     |
| twine      | unknown   | 3.2.1     |

It is also possible to read from stdin

$ cat /path/to/my/requirements.txt | pylicense

By default the result is returned as a markdown table. Other format options are available, e.g. output formatting as CSV.

$ pylicense --output-format csv path/to/my/requirements.txt
name|license|version
black|MIT|20.8b1
pylint|GPL|2.6.0
pytest|MIT|6.0.2
pytest-cov|MIT|2.10.1
sphinx|BSD|3.2.1
twine|unknown|3.2.1

By default the Python Package Index (PyPI) is queried. This can be changed with the --repository flag.

For example to query the anaconda package repository use the following command

$ pylicense --repository anaconda path/to/my/requirements.txt
| name       | license      | version   |
|:-----------|:-------------|:----------|
| black      | MIT          | 19.10b0   |
| pylint     | GPL-2        | 2.6.0     |
| pytest     | MIT          | 6.0.2     |
| pytest-cov | MIT          | 2.10.1    |
| sphinx     | BSD-2-Clause | 3.2.1     |
| twine      | Apache  2    | 2.0.0     |

Metadata

Release files for dcs-pylicense 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dcs-pylicense 0.0.3
File Size Uploaded
dcs-pylicense-0.0.3.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dcs-pylicense 0.0.3
File Interpreter ABI Platform
dcs_pylicense-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / dcs-pylicense-0.0.3.tar.gz

Download URL dcs-pylicense-0.0.3.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3202fd997f01dac1450e5cebb32b81e2cce43c9d5fbbc97ae6c3485542ee4c8a
BLAKE2b-256 checksum
How to use checksums
2a9f33d52a2f06d146311f454e3e97ce233b6967b6a68f0be9d25b9d3b14b70b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release files / dcs_pylicense-0.0.3-py3-none-any.whl

Download URL dcs_pylicense-0.0.3-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36043a8080a4bd73fbec5f9531eb2566406e32e4a515a66fd41c7543f476329c
BLAKE2b-256 checksum
How to use checksums
1f070eb49d4850eef77704c53352faa1e5bb0cd61915a713936ca267e99d4b7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page