Skip to main content

GitHosting License

License

This script scans every repo of a user (on GitHub/Bitbucket/GitLab or other providers available) for:

  • Check if include a license file
  • Download a license to the project folder (automatically execute a git commit)
  • Adds a license badge in the readme (automatically execute a git commit)
  • Include git hooks to check if your project has one.

Remember, without a license file your project is proprietary even if it is online!

Install

pip3 install gh-license

In case of a git clone:

pip3 install -e ./folder-of-the-repo

Info: This overwrites the init.templatedir global git config after creating a backup of the current value in ~/.gh-license/config.ini with the key templatedir in section main.
The installed git template contains a hook that will be installed every time you run git init. The hook reminds you to install a license if you ever forget, and disables itself after adding one.

Example

gh-license --scan Mte90

With this command you will get a report in a file called Mte90-github-license-report

gh-license --scan Mte90 --provider bitbucket

With this command you will get a report in a file called Mte90-bitbucket-license-report

gh-license --scan Mte90 --report my-report

With this command you will get a report in a file called my-report

gh-license --license-list

With this command will be showed the licenses avalaible

gh-license --license GPLv3

With this command, a GPLv3 license will be downloaded, a shields will be added in the readme and if Git is available a commit will be added and the changes will be pushed to the repo.

gh-license --license GPLv3 -- origin upstream

With this command the commit will be pushed on the upstream origin

Example of output

Metadata

Release files for gh-license 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gh-license 0.4.0
File Size Uploaded Provenance Actions
gh_license-0.4.0.tar.gz 30.1 kB Without provenance Details for gh_license-0.4.0.tar.gz

Release files / gh_license-0.4.0.tar.gz

Download URL gh_license-0.4.0.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3ee49f9c799391193f6194f01afb26e84762c12153c2560d7bc34a21d48eafdd
BLAKE2b-256 checksum
How to use checksums
9502c5246497d29db8aa1ba764743544de0ca07022297f009c68f012393e855d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for gh-license 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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