• 欢迎光临~

fastapi project template -- fastapi scaffold

开发技术 开发技术 2022-08-01 次浏览

FastAPI Project Template

https://github.com/rochacbruno/fastapi-project-template

fastapi框架的脚手架, 集成的技术都是fastapi作者推荐的:

  • SQLModel -- sqlachemy 和 pydantic的集合
  • Typer -- CLI
  • Poetry

提供

  • 安装 打包 发布 功能
  • lint test format release
  • mkdocs
  • 容器
  • pytest
  • codecov

 

The base to start an openapi project featuring: SQLModel, Typer, FastAPI, JWT Token Auth, Interactive Shell, Management Commands.

What is included on this template?

    • 🖼️ The base to start an openapi project featuring: SQLModel, Typer, FastAPI, VueJS.
    • 📦 A basic setup.py file to provide installation, packaging and distribution for your project.
      Template uses setuptools because it's the de-facto standard for Python packages, you can run make switch-to-poetry later if you want.
    • 🤖 A Makefile with the most useful commands to install, test, lint, format and release your project.
    • 📃 Documentation structure using mkdocs
    • 💬 Auto generation of change log using gitchangelog to keep a HISTORY.md file automatically based on your commit history on every release.
    • 🐋 A simple Containerfile to build a container image for your project.
      Containerfile is a more open standard for building container images than Dockerfile, you can use buildah or docker with this file.
    • 🧪 Testing structure using pytest
    • ✅ Code linting using flake8
    • 📊 Code coverage reports using codecov
    • 🛳️ Automatic release to PyPI using twine and github actions.
    • 🎯 Entry points to execute your program using python -m <project_name> or $ project_name with basic CLI argument parsing.
    • 🔄 Continuous integration using Github Actions with jobs to lint, test and release your project on Linux, Mac and Windows environments.

 

依赖 -- setuptools

https://github.com/pypa/setuptools

https://setuptools.pypa.io/en/latest/

可以将本应用的代码, 注册到库中, 这样其它应用可以访问此应用。

使用pip安装, 或者上传到pypi

https://setuptools.pypa.io/en/latest/userguide/quickstart.html

 

Documentation

Setuptools is a fully-featured, actively-maintained, and stable library designed to facilitate packaging Python projects.

It helps developers to easily share reusable code (in the form of a library) and programs (e.g., CLI/GUI tools implemented in Python), that can be installed with pip and uploaded to PyPI.

dynaconf

https://www.dynaconf.com/

https://github.com/dynaconf/dynaconf

  • Inspired by the 12-factor application guide
  • Settings management (default values, validation, parsing, templating)
  • Protection of sensitive information (passwords/tokens)
  • Multiple file formats toml|yaml|json|ini|py and also customizable loaders.
  • Full support for environment variables to override existing settings (dotenv support included).
  • Optional layered system for multi environments [default, development, testing, production] (also called multi profiles)
  • Built-in support for Hashicorp Vault and Redis as settings and secrets storage.
  • Built-in extensions for Django and Flask web frameworks.
  • CLI for common operations such as init, list, write, validate, export.

 

程序员灯塔
转载请注明原文链接:fastapi project template -- fastapi scaffold
喜欢 (0)