codemonkey800 / python-license

A simple command line utility for fetching open source licenses available from GitHub.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-license

A simple command line utility for fetching open source licenses available from GitHub.

Table of Contents

Installation

Setuptools

To install using setuptools, run:

$ python setup.py build
$ python setup.py install

Arch User Repository

You can also install it through AUR:

$ yaourt -S python-license

You can also choose to install it with git + makepkg:

$ git clone https://aur.archlinux.org/python-license
$ cd python-license
$ makepkg -si

Usage

shell Command

Install or print shell completions using click-completion.

Install Shell

$ license shell --install

Autodetection of shell requires psutils installed. It should be installed by default by setup.py.

Specify Shell

$ license shell --shell /bin/bash --install

Source in .bashrc

$ source "$(license shell --shell /bin/bash)

Source in config.fish

eval (license shell --shell /usr/bin/fish)

list Command

List all licenses available

$ license list

List licenses that match pattern

$ license list '^gpl'

get Command

Fetch MIT license and write to LICENSE.md

$ license get mit

Fetch license and write to stdout

$ license get --stdout mit

Fetch license and write to custom output

$ license get --output LICENSE mit
# or
$ license get --stdout mit > LICENSE

Caveats

As of writing, the licenses aren't templated and are provided as is. For the time being, you'll have to manually replace it:

$ license get --stdout mit | sed -i 's/\[year\]/2016/g; s/\[fullname\]/my name lmao/g'

License

The MIT License (MIT)

Copyright (c) 2016 Jeremy Asuncion

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A simple command line utility for fetching open source licenses available from GitHub.

License:MIT License


Languages

Language:Python 82.8%Language:Shell 17.2%