Fetch GitHub's MIT license template, populating this year and your name.
Create virtualenv:
$ pipenv install
Create license:
$ pipenv run python generate_mit_license.py
Print license:
$ cat LICENSE
""" | |
Fetch GitHub's MIT license template, populating this year and your name. | |
""" | |
import getpass | |
import pwd | |
from datetime import date | |
import requests | |
template = requests.get('https://api.github.com/licenses/mit').json()['body'] | |
year = date.today().strftime('%Y') | |
name = pwd.getpwnam(getpass.getuser()).pw_gecos | |
license_ = template.replace('[year]', year).replace('[fullname]', name) | |
open('LICENSE', 'w').write(license_) |
[[source]] | |
url = "https://pypi.python.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
requests = "*" | |
[dev-packages] | |
[requires] | |
python_version = "3.7" |