fastapi-template


Namefastapi-template JSON
Version 5.0.3 PyPI version JSON
download
home_pagehttps://github.com/s3rius/FastAPI-template
SummaryFeature-rich robust FastAPI template
upload_time2023-07-31 11:34:26
maintainer
docs_urlNone
authorPavel Kirilin
requires_python>=3.8,<4.0
license
keywords fastapi cookiecutter template
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![python version](https://img.shields.io/pypi/pyversions/fastapi_template?style=for-the-badge) [![version](https://img.shields.io/pypi/v/fastapi_template?style=for-the-badge)](https://pypi.org/project/fastapi-template/)
[![](https://img.shields.io/pypi/dm/fastapi_template?style=for-the-badge)](https://pypi.org/project/fastapi-template/)
<div align="center">
<img src="https://raw.githubusercontent.com/s3rius/FastAPI-template/master/images/logo.png" width=700>
<div><i>Flexible general-purpose template for FastAPI.</i></div>
</div>

## Usage

⚠️ [Git](https://git-scm.com/downloads), [Python](https://www.python.org/) and [Poetry](https://python-poetry.org/) must be installed and accessible ⚠️

Poetry version must be greater or equal than 1.1.8. Otherwise it won't be able to install SQLAlchemy.

<div align="center">
 <a href="https://asciinema.org/a/ig0oi0fOq1hxqnW5X49XaaHIT" target="_blank"><img src="https://asciinema.org/a/ig0oi0fOq1hxqnW5X49XaaHIT.svg" /></a>
  <p>Templator in action</p>
</div>

You can install it directly from pypi with pip.
```bash
python3 -m pip install fastapi_template
python3 -m fastapi_template
# or fastapi_template
# Answer all the questions
# 🍪 Enjoy your new project 🍪
cd new_project
docker-compose -f deploy/docker-compose.yml --project-directory . build
docker-compose -f deploy/docker-compose.yml --project-directory . up --build
```

If you want to install it from sources, try this:
```shell
python3 -m pip install poetry
python3 -m pip install .
python3 -m fastapi_template
```

Also, you can use it with docker.
```bash
docker run --rm -it -v "$(pwd):/projects" s3rius/fastapi_template
```

## Features

One of the coolest features is that this project is extremely configurable.
You can choose between different databases and even ORMs, or
you can even generate a project without a database!
Currently SQLAlchemy 2.0, TortoiseORM, Piccolo and Ormar are supported.

This project can run as TUI or CLI and has excellent code documentation.

Generator features:
- Pydantic V2 (Where it's possible. Some libs doesn't have support);
- You can choose between GraphQL and REST api;
- Uvicorn and gunicorn;
- Different databases support;
- Different ORMs support;
- Optional migrations for each ORM except raw drivers;
- Optional redis support;
- Optional rabbitmq support;
- different CI\CD;
- Optional Kubernetes config generation;
- Optional Demo routers and models (This helps you to see how project is structured);
- Pre-commit integration;
- Generated tests with almost 90% coverage;
- Tests for the generator itself;
- Optional Prometheus integration;
- Optional Sentry integration;
- Optional Loguru logger;
- Optional Opentelemetry integration.
- Optional taskiq integration.


This project can handle arguments passed through command line.

```shell
$ python -m fastapi_template --help

Usage: fastapi_template [OPTIONS]

Options:
  -n, --name TEXT                 Name of your awesome project
  -V, --version                   Prints current version
  --force                         Owerrite directory if it exists
  --quite                         Do not ask for features during generation
  --api-type [rest|graphql]       Select API type for your application
  --db [none|sqlite|mysql|postgresql]
                                  Select a database for your app
  --orm [none|ormar|sqlalchemy|tortoise|psycopg|piccolo]
                                  Choose Object–Relational Mapper lib
  --ci [none|gitlab_ci|github]    Select a CI for your app
  --redis                         Add redis support
  --rabbit                        Add RabbitMQ support
  --taskiq                        Add Taskiq support
  --migrations                    Add Migrations
  --kube                          Add kubernetes configs
  --dummy                         Add dummy model
  --routers                       Add example routers
  --swagger                       Add self hosted swagger
  --prometheus                    Add prometheus compatible metrics
  --sentry                        Add sentry integration
  --loguru                        Add loguru logger
  --opentelemetry                 Add opentelemetry integration
  --traefik                       Adds traefik labels to docker container
  --kafka                         Add Kafka support
  --gunicorn                      Add gunicorn server
  --help                          Show this message and exit.
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/s3rius/FastAPI-template",
    "name": "fastapi-template",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "FastAPI,Cookiecutter,Template",
    "author": "Pavel Kirilin",
    "author_email": "win10@list.ru",
    "download_url": "https://files.pythonhosted.org/packages/f7/ee/d3d6691a1771c4eb9fd8f2b89c105c4cf9ae2db25d5b60f25bae3392703e/fastapi_template-5.0.3.tar.gz",
    "platform": null,
    "description": "![python version](https://img.shields.io/pypi/pyversions/fastapi_template?style=for-the-badge) [![version](https://img.shields.io/pypi/v/fastapi_template?style=for-the-badge)](https://pypi.org/project/fastapi-template/)\n[![](https://img.shields.io/pypi/dm/fastapi_template?style=for-the-badge)](https://pypi.org/project/fastapi-template/)\n<div align=\"center\">\n<img src=\"https://raw.githubusercontent.com/s3rius/FastAPI-template/master/images/logo.png\" width=700>\n<div><i>Flexible general-purpose template for FastAPI.</i></div>\n</div>\n\n## Usage\n\n\u26a0\ufe0f [Git](https://git-scm.com/downloads), [Python](https://www.python.org/) and [Poetry](https://python-poetry.org/) must be installed and accessible \u26a0\ufe0f\n\nPoetry version must be greater or equal than 1.1.8. Otherwise it won't be able to install SQLAlchemy.\n\n<div align=\"center\">\n <a href=\"https://asciinema.org/a/ig0oi0fOq1hxqnW5X49XaaHIT\" target=\"_blank\"><img src=\"https://asciinema.org/a/ig0oi0fOq1hxqnW5X49XaaHIT.svg\" /></a>\n  <p>Templator in action</p>\n</div>\n\nYou can install it directly from pypi with pip.\n```bash\npython3 -m pip install fastapi_template\npython3 -m fastapi_template\n# or fastapi_template\n# Answer all the questions\n# \ud83c\udf6a Enjoy your new project \ud83c\udf6a\ncd new_project\ndocker-compose -f deploy/docker-compose.yml --project-directory . build\ndocker-compose -f deploy/docker-compose.yml --project-directory . up --build\n```\n\nIf you want to install it from sources, try this:\n```shell\npython3 -m pip install poetry\npython3 -m pip install .\npython3 -m fastapi_template\n```\n\nAlso, you can use it with docker.\n```bash\ndocker run --rm -it -v \"$(pwd):/projects\" s3rius/fastapi_template\n```\n\n## Features\n\nOne of the coolest features is that this project is extremely configurable.\nYou can choose between different databases and even ORMs, or\nyou can even generate a project without a database!\nCurrently SQLAlchemy 2.0, TortoiseORM, Piccolo and Ormar are supported.\n\nThis project can run as TUI or CLI and has excellent code documentation.\n\nGenerator features:\n- Pydantic V2 (Where it's possible. Some libs doesn't have support);\n- You can choose between GraphQL and REST api;\n- Uvicorn and gunicorn;\n- Different databases support;\n- Different ORMs support;\n- Optional migrations for each ORM except raw drivers;\n- Optional redis support;\n- Optional rabbitmq support;\n- different CI\\CD;\n- Optional Kubernetes config generation;\n- Optional Demo routers and models (This helps you to see how project is structured);\n- Pre-commit integration;\n- Generated tests with almost 90% coverage;\n- Tests for the generator itself;\n- Optional Prometheus integration;\n- Optional Sentry integration;\n- Optional Loguru logger;\n- Optional Opentelemetry integration.\n- Optional taskiq integration.\n\n\nThis project can handle arguments passed through command line.\n\n```shell\n$ python -m fastapi_template --help\n\nUsage: fastapi_template [OPTIONS]\n\nOptions:\n  -n, --name TEXT                 Name of your awesome project\n  -V, --version                   Prints current version\n  --force                         Owerrite directory if it exists\n  --quite                         Do not ask for features during generation\n  --api-type [rest|graphql]       Select API type for your application\n  --db [none|sqlite|mysql|postgresql]\n                                  Select a database for your app\n  --orm [none|ormar|sqlalchemy|tortoise|psycopg|piccolo]\n                                  Choose Object\u2013Relational Mapper lib\n  --ci [none|gitlab_ci|github]    Select a CI for your app\n  --redis                         Add redis support\n  --rabbit                        Add RabbitMQ support\n  --taskiq                        Add Taskiq support\n  --migrations                    Add Migrations\n  --kube                          Add kubernetes configs\n  --dummy                         Add dummy model\n  --routers                       Add example routers\n  --swagger                       Add self hosted swagger\n  --prometheus                    Add prometheus compatible metrics\n  --sentry                        Add sentry integration\n  --loguru                        Add loguru logger\n  --opentelemetry                 Add opentelemetry integration\n  --traefik                       Adds traefik labels to docker container\n  --kafka                         Add Kafka support\n  --gunicorn                      Add gunicorn server\n  --help                          Show this message and exit.\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Feature-rich robust FastAPI template",
    "version": "5.0.3",
    "project_urls": {
        "Homepage": "https://github.com/s3rius/FastAPI-template",
        "Repository": "https://github.com/s3rius/FastAPI-template"
    },
    "split_keywords": [
        "fastapi",
        "cookiecutter",
        "template"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfbf0db0fb17e1c5b94f435d84d6871881bb9071dea2d63a32905a7e8158e086",
                "md5": "965bc88627f37da5ba8f3a5eb153b901",
                "sha256": "c27010cc38a9739ce18a6082db90b9c796f10b7db9b0dc30d1d139baa6fac39a"
            },
            "downloads": -1,
            "filename": "fastapi_template-5.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "965bc88627f37da5ba8f3a5eb153b901",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 868343,
            "upload_time": "2023-07-31T11:34:24",
            "upload_time_iso_8601": "2023-07-31T11:34:24.760655Z",
            "url": "https://files.pythonhosted.org/packages/df/bf/0db0fb17e1c5b94f435d84d6871881bb9071dea2d63a32905a7e8158e086/fastapi_template-5.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7eed3d6691a1771c4eb9fd8f2b89c105c4cf9ae2db25d5b60f25bae3392703e",
                "md5": "ec83bb1cb1fb975d4e157b5862d1cf9b",
                "sha256": "c7f016700b04c244c067af63ebe063b16d325a991808b7116290300ca49c9756"
            },
            "downloads": -1,
            "filename": "fastapi_template-5.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "ec83bb1cb1fb975d4e157b5862d1cf9b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 802557,
            "upload_time": "2023-07-31T11:34:26",
            "upload_time_iso_8601": "2023-07-31T11:34:26.630499Z",
            "url": "https://files.pythonhosted.org/packages/f7/ee/d3d6691a1771c4eb9fd8f2b89c105c4cf9ae2db25d5b60f25bae3392703e/fastapi_template-5.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-31 11:34:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "s3rius",
    "github_project": "FastAPI-template",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fastapi-template"
}
        
Elapsed time: 0.18624s