Skip to main content

量潮项目管理FastAPI工具箱

Project description

fastapi-quanttide-project

量潮项目管理 FastAPI 工具箱。

用法

from fastapi import FastAPI
from quanttide_project import Project, Task
from fastapi_quanttide_project import ModelRouter

app = FastAPI()

# 存储由用户自己管理,你可以用 dict、SQLite、Redis……
projects: dict[str, Project] = {}
tasks: dict[str, Task] = {}

app.include_router(ModelRouter(Project).build(
    create=lambda _id, p: projects.setdefault(_id, p) or p,
    get=projects.get,
    list_all=lambda: list(projects.values()),
    update=lambda _id, p: projects.update({_id: p}) or p,
    delete=lambda _id: projects.pop(_id, None) is not None,
))

app.include_router(ModelRouter(Task).build(
    create=lambda _id, t: tasks.setdefault(_id, t) or t,
    get=tasks.get,
    list_all=lambda: list(tasks.values()),
    update=lambda _id, t: tasks.update({_id: t}) or t,
    delete=lambda _id: tasks.pop(_id, None) is not None,
))

安装

pip install fastapi-quanttide-project

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

fastapi_quanttide_project-0.1.1.tar.gz (114.1 kB view details)

Uploaded Source

Built Distribution

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

fastapi_quanttide_project-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_quanttide_project-0.1.1.tar.gz.

File metadata

File hashes

Hashes for fastapi_quanttide_project-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cbfe7690c3d26490b1718792cd0cdd39ebee6aa50382ab581625c5519e937ba8
MD5 8dad5bce5c186d53ba2c1d61aefaab59
BLAKE2b-256 51f999852cb09df30bfa0efe06dc72bf5afa12c5db54149f4f6c31451b4a1eeb

See more details on using hashes here.

File details

Details for the file fastapi_quanttide_project-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_quanttide_project-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec16a6e0605057ad4d8f7a5c09df22de66d1c95037a462977de9da197669d9e5
MD5 30103a7582b38c43bd7a161575fcb269
BLAKE2b-256 1624b0db20fb853dcb4eb41539392976eba95e89f3b8051569f8493b13176a33

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