GithubHelp home page GithubHelp logo

dotcs / pylicense Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 31 KB

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

License: GNU General Public License v3.0

Python 100.00%
python python3 cli license license-checking license-checker

pylicense's Introduction

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     |

pylicense's People

Contributors

dotcs avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.