Skip to main content

class_d

icon

python PEP8 license

An interactive utility for creating GitHub-style licenses locally with date and name.

Requirements

* pip will install these automatically.

Installation

pip install coming soon!

Setup

class_d will perform all necessary setup on first run.

Usage

class_d as a Program

class_d

-f --favorite

Create a LICENSE file specified by "favorite" in ~/.config/class_d/settings.json.

class_d as a Library

#!/usr/bin/env python3
"""example file"""

import class_d

if __name__ == "__main__":
    license_list = class_d.get_license_list()
    specific_license = class_d.get_license(license_list["MIT"])

get_license_list()

Return a dictionary of license names and GitHub API keys from https://api.github.com/licenses.

{'AGPL-3.0': 'agpl-3.0',
 'Apache-2.0': 'apache-2.0',
 'BSD-2-Clause': 'bsd-2-clause',
 'BSD-3-Clause': 'bsd-3-clause',
 'CC0-1.0': 'cc0-1.0',
 'EPL-2.0': 'epl-2.0',
 'GPL-2.0': 'gpl-2.0',
 'GPL-3.0': 'gpl-3.0',
 'LGPL-2.1': 'lgpl-2.1',
 'LGPL-3.0': 'lgpl-3.0',
 'MIT': 'mit',
 'MPL-2.0': 'mpl-2.0',
 'Unlicense': 'unlicense'}

get_license(key)

Return the body of a license from https://api.github.com/licenses/{key}.

get_license("mit")
"MIT License\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"

TODO

  • Add -f flag to use favorite license.
  • Complete documentation in README.
  • Complete PEP-8 compliance.
  • Full argparse for --help support.
  • Provide library for useful functions.
  • Distribute on pip.

Download files

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

Source Distribution

class_d-oliversandli-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

class_d_oliversandli-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file class_d-oliversandli-0.0.1.tar.gz.

File metadata

  • Download URL: class_d-oliversandli-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for class_d-oliversandli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 845230dda08c9640857cc001de07bf081118a80c1365664be708b55d9f6dc7b1
MD5 0ae08f92ccce934b1d7e4dc5df9a0674
BLAKE2b-256 83f7e2c73b7dcd05744bba5e2fc192cf296e5552362927b5f455b57e7396780c

See more details on using hashes here.

File details

Details for the file class_d_oliversandli-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: class_d_oliversandli-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for class_d_oliversandli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6db6045e3208baedef8dfc827f207efc847c466bc685f6aae2e29074f0c10795
MD5 081f88a746f4f4d9c3926f7b6b0fcb5a
BLAKE2b-256 b66c401aa35ad3b64eb7660ba1132102e76a56f5fb55b35934fa78d551c2b7df

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.0

1 file

This release

0.0.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page