https://github.com/leynier/python-template
Python template with CI/CD ready for production
https://github.com/leynier/python-template
boilerplate ci-cd codecov cookiecutter fastapi fastapi-template github-actions github-pages github-template github-workflows mkdocs mkdocs-material opensource python python-3 python-poetry python-template python3 template typer
Last synced: about 2 months ago
JSON representation
Python template with CI/CD ready for production
- Host: GitHub
- URL: https://github.com/leynier/python-template
- Owner: leynier
- License: mit
- Created: 2020-12-04T02:58:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-30T14:14:58.000Z (over 3 years ago)
- Last Synced: 2025-03-15T23:17:58.727Z (2 months ago)
- Topics: boilerplate, ci-cd, codecov, cookiecutter, fastapi, fastapi-template, github-actions, github-pages, github-template, github-workflows, mkdocs, mkdocs-material, opensource, python, python-3, python-poetry, python-template, python3, template, typer
- Language: Makefile
- Homepage:
- Size: 288 KB
- Stars: 34
- Watchers: 4
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Python Template
[](https://opensource.org/licenses/MIT)
[](https://github.com/leynier/python-template/commits)
[](https://github.com/leynier/python-template/commits)
[](https://github.com/leynier/python-template/stargazers)
[](https://github.com/leynier/python-template/network/members)
[](https://github.com/leynier/python-template)
[](https://leynier.github.io/python-template)
[](https://github.com/leynier/python-template/graphs/contributors)Python template with CI/CD ready for production
## Branches
- [main](https://github.com/leynier/python-template): For libraries and/or console applications
- [typer](https://github.com/leynier/python-template): Command line interfaces implemented with [Typer](https://typer.tiangolo.com)
- [fastapi](https://github.com/leynier/python-template/tree/fastapi): For web applications implemented with [FastAPI](https://fastapi.tiangolo.com)## Features
### Main Features
- Management of dependencies with [Poetry](https://python-poetry.org)
- Generation of documentation based on Markdown with [Material for Mkdocs](https://squidfunk.github.io/mkdocs-material)
- Automatic check of the pythonic style with [flake8](https://flake8.pycqa.org), [black](https://black.readthedocs.io) and [isort](https://pycqa.github.io/isort)
- Automatic code checking with [pytest](https://pytest.org)
- Automatic code report with [codecov](https://codecov.io)
- Automatic code reviews with [deepsource](https://deepsource.io)
- Automatic publish to [GitHub Releases](https://docs.github.com/es/free-pro-team@latest/github/administering-a-repository/releasing-projects-on-github)
- Automatic publish to [PyPI](https://pypi.org)
- Automatic dependency update check with [dependabot](https://github.com/dependabot)### FastAPI Features
- Configuration for deploy on [Heroku](https://www.heroku.com)
- Configuration for deploy with [Docker](https://www.docker.com)> All of the above via [GitHub Actions](https://github.com/features/actions) and [GitHub Pages](https://pages.github.com)
## Tutorial
### Install `cookiecutter` ([Official Instructions](https://cookiecutter.readthedocs.io/en/latest/installation.html#install-cookiecutter))
At the command line:
```bash
python3 -m pip install --user cookiecutter
```Or, if you do not have pip:
```bash
easy_install --user cookiecutter
```Though, `pip` is recommended.
Or, if you are using `conda`, first add `conda-forge` to your channels:
```bash
conda config --add channels conda-forge
```Once the `conda-forge` channel has been enabled, cookiecutter can be installed with:
```bash
conda install cookiecutter
```#### Alternate installations
**Homebrew (Mac OS X only):**
```bash
brew install cookiecutter
```**Pipx (Linux, OSX and Windows):**
```bash
pipx install cookiecutter
```**Debian/Ubuntu:**
```bash
sudo apt-get install cookiecutter
```#### Upgrading from `0.6.4` to `0.7.0` or greater
First, read [History](https://cookiecutter.readthedocs.io/en/latest/HISTORY.html) in detail. There are a lot of major changes. The big ones are:
Cookiecutter no longer deletes the cloned repo after generating a project.
Cloned repos are saved into `~/.cookiecutters/`.
You can optionally create a `~/.cookiecutterrc` config file.
Upgrade **Cookiecutter** either with `easy_install`:
```bash
easy_install --upgrade cookiecutter
```Or with pip:
```bash
python3 -m pip install --upgrade cookiecutter
```### Usage
Then, after you have installed `cookiecutter`, execute the following command in the terminal of your choice:
```bash
cookiecutter gh:leynier/python-template --checkout
```Where `` can be `main`, `fastapi`, `typer`, etc.
#### Example using FastAPI template
```bash
cookiecutter gh:leynier/python-template --checkout fastapi
```## License
This project is collaborative and open source under the [MIT license](LICENSE). Contributions are super appreciated.