infer-license0.2.0
infer-license0.2.0
Published
A script to guess licenses based on text
pip install infer-license
Package Downloads
Authors
Project URLs
Requires Python
>=3.10
Dependencies
- dataclasses
>=0.7 ; python_version < "3.7"
- importlib-resources
; python_version < "3.7"
- black
==23.12.1 ; extra == 'dev'
- checkdeps
==0.0.2 ; extra == 'dev'
- flake8
==7.0.0 ; extra == 'dev'
- mypy
==1.8.0 ; extra == 'dev'
- tox
==4.12.1 ; extra == 'dev'
- twine
==4.0.2 ; extra == 'dev'
- ufmt
==2.3.0 ; extra == 'dev'
- usort
==1.0.7 ; extra == 'dev'
- wheel
==0.42.0 ; extra == 'dev'
- coverage
>=6 ; extra == 'test'
infer-license
Heavily inspired by https://github.com/sol/infer-license/ this will provide an API to guess what license a given file represents.
>>> from infer_license import guess_file
>>> print(guess_file("LICENSE"))
License(name='MIT License', shortname='MIT', trove_classifier='License :: OSI Approved :: MIT License')
>>> guess_file("setup.py")
None
There's also a handy infer_license
script that takes a filename.
$ infer_license LICENSE
LICENSE: MIT
License
infer-license is copyright Tim Hatch, and licensed under
the MIT license. I am providing code in this repository to you under an open
source license. This is my personal repository; the license you receive to
my code is from me and not from my employer. See the LICENSE
file for details.