spdx许可证列表查询工具

spdx-lookup的Python项目详细描述


用于查询SPDX许可证列表的工具。

用法

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

命令行工具

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

许可证

BSD 2条款。见许可证。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
正在用户处创建的java文件。在Ubuntu中使用home而不是相对路径   使用Java查找数组中3的最后倍数   java SimpleDataFormat。解析(日期\字符串)生成上一个日期   如何在Java项目中使用Android的LogCat?   java Basic swing ui在默认值之外的其他“main”方法中使用   java如何设置log4j的最大文件大小不受限制?   摇摆Java框架游戏   用Java DOM解析XML文件   java获取素数   java什么是最好的UI元素拖动算法   java十进制到二进制转换器循环   java可以为同一个项目创建多个jar文件吗   JavaZK将组件添加到特定页面