为项目生成许可证文件
lice的Python项目详细描述
lice生成许可文件。不再从其他项目中寻找许可证。
安装
关于您的期望:
easy_install lice
或:
pip install lice
概述
生成BSD-3许可证,默认值:
$ lice Copyright (c) 2013, Jeremy Carbaugh All rights reserved. Redistribution and use in source and binary forms, with or without modification, ...
生成麻省理工学院许可证:
$ lice mit The MIT License (MIT) Copyright (c) 2013 Jeremy Carbaugh Permission is hereby granted, free of charge, to any person obtaining a copy ...
生成BSD-3许可证,指定要使用的年份和组织:
$ lice -y 2012 -o "Sunlight Foundation" Copyright (c) 2012, Sunlight Foundation All rights reserved. Redistribution and use in source and binary forms, with or without modification, ...
生成一个bsd-3许可证,格式为python源文件:
$ lice -l py # Copyright (c) 2012, Sunlight Foundation # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, ...
生成一个python源文件,该文件的头部注释了bsd-3许可证:
$ lice -l py -f test $ ls test.py $ cat test.py # Copyright (c) 2012, Sunlight Foundation # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, ...
生成源文件(由-f扩展名检测到的语言):
$ lice -f test.c && cat test.c /* * Copyright (c) 2012, Sunlight Foundation * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, ...
如果未指定组织,则lice将首先尝试使用git config查找您的姓名。如果找不到,它将使用$USER环境变量的值。如果未指定项目名称,则使用当前目录的名称。年份将默认为当前年份。
您可以查看可用于任何许可证的变量:
$ lice --vars mit The mit license template contains the following variables: year organization
我要这里的xxxxxxxx许可证!
太好了!这是常用的许可证吗?如果是的话,打开一个问题,或者,如果你觉得慷慨大方的话,叉并提交一个拉请求。
用法
usage: lice [-h] [-o ORGANIZATION] [-p PROJECT] [-t TEMPLATE_PATH] [-y YEAR] [--vars] [license] positional arguments: license the license to generate, one of: agpl3, apache, bsd2, bsd3, cddl, cc0, epl, gpl2, gpl3, lgpl, mit, mpl optional arguments: -h, --help show this help message and exit -o ORGANIZATION, --org ORGANIZATION organization, defaults to .gitconfig or os.environ["USER"] -p PROJECT, --proj PROJECT name of project, defaults to name of current directory -t TEMPLATE_PATH, --template TEMPLATE_PATH path to license template file -y YEAR, --year YEAR copyright year -l LANGUAGE, --language LANGUAGE format output for language source file, one of: js, f, css, c, m, java, py, cc, h, html, lua, erl, rb, sh, f90, hpp, cpp, pl, txt [default is not formatted (txt)] -f OFILE, --file OFILE Name of the output source file (with -l, extension can be omitted) --vars list template variables for specified license
更改日志
0.4
- 模板使用ascii而不是unicode(感谢tabletcorry)
- 添加学术免费许可(“AFL”)v.3.0(感谢brianray)
- 添加isc(感谢masklinn)
- 添加对测试的tox支持(感谢lukaszb)
- 列出模板变量时显示默认值
0.3
- 为某些许可证持有人生成源文件头
- 在运行时发现可用的许可证
- 使用getpass模块检索用户名
- 对python 3更好的unicode支持(感谢astagi)
- 添加Creative Commons许可证(感谢rjnienaber)
0.2
- 添加AGPL 3许可证
- 向gpl 2和gpl 3添加额外的模板变量
0.1
- 初始版本