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 Hibernate@ManyToMany mapping只在一个方向上在数据库中添加记录   java将文件上载到tomcat服务器外部的文件夹   java将摄像头捕获的图像上传到服务器   java如何创建Rest API并为进程添加时间延迟?   springmodulesvalidation0中缺少java注释包。8a源文件   如何在java中打印SOAP头   Spring security中的java自定义消息,包括UserDetailsService实现和异常   java如何使用Htmlunit中的表单数据登录站点   web如何在WildFly上自动运行java文件   java如何从已经使用另一个方法传递的参数的方法中获取返回值?   java我在JFrame上有一个索引越界。setContentPane   java中的循环序列/系列打印   java maven 3 webapp没有要运行的测试吗?   java CORS不允许POST请求   java再次在派生类中的Jackson中添加字段,该字段在基类中被忽略   爪哇坑测试显示仆从由于超时而异常退出   java寻找第10001个素数   java jboss是否更改web应用程序上下文根?