fastapi-scaff
What is this?
- by: axiner
- fastapi-scaff
- This is a fastapi scaff.
- new project
- add api
- tpl template
- about project:
- auto init project (conf, db, log...)
- auto register router
- auto add middleware/exceptions
- integrated api-key/jwt
- integrated sqlalchemy
- integrated migration
- integrated celery
- integrated docker
- ...
- more documents: 请点击链接
Project template
-
Architecture: ASM
- A api
- S services
- M models
-
Flow: main.py(app) - core(middleware) - api - services - models
-
Layout:
- The naming has been finalized after multiple revisions, making it concise and easy to understand.
- Some modules are integrated via the following methods:
- Flexibly enable modules (database, loguru, redis, etc.) through parameters when creating a project with new.
- Easily integrate templates (celery, docker, swarm, etc.) into existing projects using the tpl command.
└── fastapi-scaff ├── app (应用) │ ├── api ├── (接口) │ │ └── v1 │ └── (版本1) │ ├── core ├── (基础) │ │ ├── conf │ ├── (配置) │ │ ├── db │ ├── (数据库) │ │ ├── log │ ├── (日志) │ │ └── ... │ └── (...) │ ├── models ├── (数据模型) │ ├── services ├── (业务逻辑) │ ├── utils ├── (工具集) │ └── main.py └── (主入口) ├── app_celery (应用-异步任务) ├── config (配置目录) ├── docs (文档目录) ├── tests (测试目录) ├── .dockerignore ├── .gitignore ├── .python-version ├── docker-build.sh ├── docker-compose.yaml ├── Dockerfile ├── LICENSE ├── README.md ├── requirements.txt └── runserver.py -
【Other】
- light:Please create and view (with
-t light) - tiny:Please create and view (with
-t tiny) - single:Please create and view (with
-t single)
- light:Please create and view (with
Installation
This package can be installed using pip (Python>=3.11):
pip install fastapi-scaff
Scaff usage
- 1)help document
fastapi-scaff -h
- 2)new project
fastapi-scaff new <myproj>- light:
fastapi-scaff new <myproj> -t light - tiny:
fastapi-scaff new <myproj> -t tiny - single:
fastapi-scaff new <myproj> -t single
- 3)add api
cd to project root dirfastapi-scaff add <myapi>
- x)integrated celery
- New project:
fastapi-scaff new <myproj> --celery - Existing project:
fastapi-scaff tpl celery -p <mycelery>
- New project:
Project run
- 1)cd to project root dir
- 2)modify the configuration, such as for the database
- 3)
pip install -r requirements.txt - 4)
python runserver.py- more parameters see:
- about uvicorn: click here
- about gunicorn: click here
- more parameters see:
- x)migration
- create project with migration support:
fastapi-scaff new <myproj> --migration - execution commands (run before server startup):
- generate:
python runmigration.py generate init - upgrade:
python runmigration.py upgrade
- generate:
- about alembic: click here
- create project with migration support:
- x)docker
- project files:
- Dockerfile*
- docker-build.sh (default Dockerfile)
- docker-compose.yaml
- about docker: click here
- project files:
License
This project is released under the MIT License (MIT). See LICENSE
☕ 请我喝咖啡
享受开源,也感谢支持。
如果本项目对您有用,Buy Me a Coffee :)
Metadata
Release files for fastapi-scaff 0.12.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_scaff-0.12.6-py3-none-any.whl | Python 3 | none | any | Details |
Release files / fastapi_scaff-0.12.6-py3-none-any.whl
| Download URL | fastapi_scaff-0.12.6-py3-none-any.whl |
|---|---|
| Size | 83.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04f219d3a4a35dfe9772f7effbb38e69fddfdd9ad61bccc2c23a76dbb8da51b0
|
|
BLAKE2b-256 checksum How to use checksums |
0c68f1d223f639c444079746953e6737c728668628aeadd51d6808b705cbc842
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for fastapi-scaff 0.12.6
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.