Skip to main content

FastAPI service scaffold aligned with bm-ai team PATTERNS.md

Project description

bm-fastapi-scaffold

一行命令起一个对齐团队 PATTERNS.md 的 FastAPI monorepo + 首个子服务。

安装

pip install bm-fastapi-scaffold

用法

bm-fastapi-scaffold init my-business-project
# 默认 --service app --port 30000 --target .

bm-fastapi-scaffold init my-business-project --service core --port 30010
bm-fastapi-scaffold init my-business-project --target ~/repos

生成结构:

my-business-project/
├── .env.example
├── .gitignore
├── .gitlab-ci.yml
├── .pre-commit-config.yaml
├── README.md
├── compose.local.yaml
├── install_dev.sh
├── mypy.ini
├── requirements_dev.txt
└── agents/
    └── app/
        ├── app/
        │   ├── __init__.py
        │   ├── _info.py
        │   ├── _log.py
        │   ├── app.py
        │   ├── interface_models.py
        │   ├── server.py
        │   └── settings.py
        ├── tests/
        ├── Dockerfile
        ├── .dockerignore
        ├── start_server.sh
        ├── build.sh
        ├── pyproject.toml
        ├── requirements.txt
        └── requirements_wheels.txt

起服务

cd my-business-project
bash install_dev.sh
cd agents/app
python -m app.server
curl http://localhost:30000/

规范

模板对齐 bm-ai 团队 PATTERNS.md

  • settings.py{env: value} 字典分环境(不写 if/elif)
  • _info.pytomllib 读 pyproject 版本(不用 importlib.metadata
  • pyproject.tomlrequires-python = ">=3.12,<3.13" 上限
  • .dockerignore*.egg-info 避免污染 build
  • Dockerfile 钉死 base 镜像 tag
  • 日志走 util_common.logger.setup_loggers 异步 JSON logger

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bm_fastapi_scaffold-0.0.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bm_fastapi_scaffold-0.0.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file bm_fastapi_scaffold-0.0.1.tar.gz.

File metadata

  • Download URL: bm_fastapi_scaffold-0.0.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for bm_fastapi_scaffold-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d31622d8e3cee87f22d79f81d7ab5b2045a9e3721bf32069565dbcf6bb453d62
MD5 39bdca6e84ae3cecd84c1a996928f273
BLAKE2b-256 b9c1bf803f8b5bd4c5bf8c9152113298cc91727c71d24531cee07d5914e95495

See more details on using hashes here.

File details

Details for the file bm_fastapi_scaffold-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bm_fastapi_scaffold-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 113e654f794ab4cb96b7311400985083b3fa5c787a59fceb08e19c29a07938c1
MD5 bfd14bfddf904d83af318b62b3b28447
BLAKE2b-256 fd03bf5c18f310aa11c69c411e59ea5ed55371f63b607ef1e277e5af50f85fff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page