Skip to main content

Generate license files for your projects

Project description

lice

Lice generates license files. No more hunting down licenses from other projects.

Installation

About what you'd expect:

pip install lice

Overview

Generate a BSD-3 license, the default:

$ lice
Copyright (c) 2013, Jeremy Carbaugh

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
...

Generate an MIT license:

$ lice mit
The MIT License (MIT)
Copyright (c) 2013 Jeremy Carbaugh

Permission is hereby granted, free of charge, to any person obtaining a copy
...

Generate a BSD-3 license, specifying the year and organization to be used:

$ 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,
...

Generate a BSD-3 license, formatted for python source file:

$ lice -l py

# Copyright (c) 2012, Sunlight Foundation
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
...

Generate a python source file with a BSD-3 license commented in the header:

$ 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,
...

Generate a source file (language detected by -f extension):

$ 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,
 ...

If organization is not specified, lice will first attempt to use git config to find your name. If not found, it will use the value of the $USER environment variable. If the project name is not specified, the name of the current directory is used. Year will default to the current year.

You can see what variables are available to you for any of the licenses:

$ lice --vars mit
The mit license template contains the following variables:
  year
  organization

I want XXXXXXXXX license in here!

Great! Is it a license that is commonly used? If so, open an issue or, if you are feeling generous, fork and submit a pull request.

Usage

    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

Changelog

0.6

  • Add PowerShell support (thanks to danijeljw <https://github.com/danijeljw>_)
  • Add Rust support (thanks to alex179ohm <https://github.com/alex179ohm>_)
  • Bugfixes (thanks to ganziqim <https://github.com/ganziqim>_)
  • Added support for Python 3.7 and 3.8, removed support for Python 3.4

Tested against Python 2.7, 3.5, 3.6, 3.7, and 3.8.

0.5

  • Add support for SCM alias for lisp-style comments (thanks to ejmr <https://github.com/ejmr>_)
  • Additional support for WTFPL and GPL2 licenses (thanks to ejmr <https://github.com/ejmr>_)
  • Support for Python 3.4 and 3.5 (thanks to ejmr <https://github.com/ejmr>_)

0.4

  • Use ASCII instead of Unicode for templates (thanks to tabletcorry <https://github.com/tabletcorry>_)
  • Add Academic Free License ("AFL") v. 3.0 (thanks to brianray <https://github.com/brianray>_)
  • Add ISC (thanks to masklinn <https://github.com/masklinn>_)
  • Add tox support for testing (thanks to lukaszb <https://github.com/lukaszb>_)
  • Show defaults when listing template variables

0.3

  • Generate source file headers for some liceneses
  • Discover available licenses at runtime
  • Use getpass module for retrieving username
  • Better unicode support for Python 3 (thanks to astagi <https://github.com/astagi>_)
  • Add Creative Commons licenese (thanks to rjnienaber <https://github.com/rjnienaber>_)

0.2

  • Add AGPL 3 license
  • Add extra templates variables to GPL 2 and 3

0.1

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lice2-0.7.0.tar.gz (73.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lice2-0.7.0-py3-none-any.whl (120.4 kB view details)

Uploaded Python 3

File details

Details for the file lice2-0.7.0.tar.gz.

File metadata

  • Download URL: lice2-0.7.0.tar.gz
  • Upload date:
  • Size: 73.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.8.0-40-generic

File hashes

Hashes for lice2-0.7.0.tar.gz
Algorithm Hash digest
SHA256 d9286b7d5ad0c2013c80c180ce80bd554b80b08b3e3ad8fba838865a9746c188
MD5 3142743df169be46caf5fddc4f215d28
BLAKE2b-256 8d9b08f9eb93f3dab0a4b6c1c045d143eeb7445665a921e3d0829829763ce2fc

See more details on using hashes here.

File details

Details for the file lice2-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: lice2-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 120.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.8.0-40-generic

File hashes

Hashes for lice2-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cf61f7d0b82376e89fbaa49790dca30c7a3384d5fc94f8879b3dad1e7b8795c
MD5 f19293b3e70d351e496a7d78d4d8405a
BLAKE2b-256 752bc717043d13e7a49cbafa0da4d551e020c76eb684981fe3c52783ea7b45c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page