Metadata-Version: 2.4
Name: spdx-lookup
Version: 0.3.3
Summary: SPDX license list query tool
Home-page: https://github.com/bbqsrc/spdx-lookup-python
Author: Brendan Molloy
Author-email: brendan+pypi@bbqsrc.net
License: BSD-2-Clause
Keywords: spdx,licenses,database,lookup,query
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
License-File: LICENSE
Requires-Dist: spdx>=2.3.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

spdx-lookup
===========

A tool to query the SPDX license list.

Usage
-----

API
~~~

::

    import spdx_lookup as lookup

    # Case-insensitive SPDX id lookup
    lookup.by_id('gpl-3.0') # -> returns License object or None

    # Case-insensitive SPDX name lookup
    lookup.by_name('gpl-3.0') # -> returns License object or None

    # Find closest match for provided license content
    with open('some-license.txt') as f:
        match = lookup.match(f.read()) # -> returns LicenseMatch or None

    match.confidence # -> a float between 0 and 100
    match.license # -> a License object

Command-line tool
~~~~~~~~~~~~~~~~~

::

    usage: spdx-lookup [-h] (-i ID | -n NAME | -d DIR | -f FILE)
                       {template,info} ...

    optional arguments:
      -h, --help            show this help message and exit

    Lookup method:
      -i ID, --id ID        Find license with given identifier
      -n NAME, --name NAME  Find license with given name
      -d DIR, --dir DIR     Search directory for valid license
      -f FILE, --file FILE  Read file to detect license

    Actions:
      {template,info}
        template            print license template
        info                print metadata about license

License
-------

BSD 2-clause. See LICENSE.
