Metadata-Version: 2.4
Name: gh-license
Version: 0.4.0
Summary: Scan github, bitbucket or other providers repositories for missing license files and add them
Home-page: https://github.com/Mte90/GH-License
Download-URL: https://github.com/Mte90/GH-License/tarball/0.3.0
Author: Mte90
Author-email: Mte90 <mte90net@gmail.com>
License: GPLv3
Project-URL: Homepage, https://github.com/Mte90/GH-License
Project-URL: Download, https://github.com/Mte90/GH-License/tarball/0.4.0
Keywords: github,bitbucket,gitlab,license,scanner
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygithub>=1.5.0
Requires-Dist: bitbucket-api>=0.5.0
Requires-Dist: python-gitlab>=3.1.5.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Dynamic: author
Dynamic: download-url
Dynamic: home-page
Dynamic: license-file

# GitHosting License
[![License](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)

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](https://gist.github.com/Mte90/4c5ec76c94afa61983f8)
