Skip to main content

NAME

Project description

Lookup License

Python tool to identify license from license text or license names.

With lookup-license you can lookup the license from:

The first lookup takes a bit of time, due to initialization, so if you want to do a number of lookups you might want to use the interactive shell.

Using lookup-license

Lookup license without argument

If you do not provide an argument lookup-license assumes you want to copy/paste license information interactively. Let's say we want to lookup the license mit.

$ lookup-license
Enter license text and press Control-d.
>>> mit
MIT

In the example above:

  • Enter license text and press Control-d. is usage information

  • >>> is the lookup-license prompt

  • mit is the input the user provided

  • MIT is the result from lookup-license

Lookup license passed as an argument

You want to lookup the license "MIT AND BSD3":

$ lookup-license "MIT AND BSD3"
MIT AND BSD-3-Clause

Lookup license information in a file

If you pass a file name without the --file option the file name is treated as an argument containing license text. So the following will not lookup the license text in LICENSE.TXT.

$ lookup-license "LICENSE.TXT"

If you want lookup-license to read the content and try to identify the license based on that, then you need to use the --file option.

Interactively provide the file name

lookup-license --file
Enter license file name and press enter.
>>> LICENSE.txt
CC-BY-4.0

Provide the file name as an argument

lookup-license --file LICENSE.txt
CC-BY-4.0

Lookup license information form a URL

Same as described earlier with file names, if you pass a URL to lookup-license it will be treated as license information. If you want to lookup the URL content you need to use the --url option.

Interactively provide the URL

lookup-license --url
Enter license URL name and press enter.
>>> https://github.com/psf/requests/blob/main/LICENSE
Apache-2.0

Provide the URL as an argument

lookup-license --url https://github.com/psf/requests/blob/main/LICENSE
Apache-2.0

interactive shell

Here is an example session for looking up the text mit followed the URL https://github.com/psf/requests/blob/main/LICENSE:

lookup-license --shell
Welcome to the LookupLicense shell. Type help or ? to list commands.

>>> text 
Enter license text and press Control-d.
>>> mit
['MIT']
>>> url 
Enter license URL name and press enter.
>>> https://github.com/psf/requests/blob/main/LICENSE
['Apache-2.0']

Acknowledgements

Lookup license is a tiny wrapper on top of the following python modules:

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

lookup_license-0.1.17.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lookup_license-0.1.17-py2.py3-none-any.whl (21.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file lookup_license-0.1.17.tar.gz.

File metadata

  • Download URL: lookup_license-0.1.17.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lookup_license-0.1.17.tar.gz
Algorithm Hash digest
SHA256 7cb7c6c17f26c7e614d2fbd575a23e4ebdf14da0a5fb2c2f68e1892a389b460a
MD5 8b9a896b7d52bc95e1b8fda79779e0f4
BLAKE2b-256 99726a64d46462a30138e7d9446c04d2ec324b546f80cf4ba34c604521f69e30

See more details on using hashes here.

File details

Details for the file lookup_license-0.1.17-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for lookup_license-0.1.17-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7787ed8ac8d1053746f888669513b366115c9eb019d9d752d868a3a1e940ae7d
MD5 ae95f4e950bfcdd2bf0693fea4f70d16
BLAKE2b-256 76f2aad45c98df564cc0d6cd8c168ea64065a03b9ab4ef9676cd9892bb6b7f0d

See more details on using hashes here.

Supported by

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