Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CheeseAPI

一款协程友好的 web 框架

该框架为个人设计,仅供学习交流使用,各种 API 目前不会保证稳定性和向后兼容性

安装

pip install CheeseAPI

依赖

  1. CheeseLog

日志系统,CheeseAPI 使用它进行日志的输出与记录

  1. CheeseSignal

信号系统,CheeseAPI 使用它进行所有事件信号的管理与分发

项目结构

CheeseAPI采用模块结构:

| - User
    | - __init__.py
    | - model.py
    | - api.py
    | - scheduler.py
    | - service.py
    | - handle.py
    | - validator.py
| - Permission
    | - __init__.py
    | - model.py
    | - api.py
    | - service.py
    | - validator.py
| - __init__.py
| - app.py

CheeseAPI 并没有强制规定文件名,但建议的文件命名方式如下:

文件名 备注
__init__.py 公用变量
model.py ORM或类
api.py API接口
scheduler.py 定时任务
service.py 业务逻辑实现
handle.py 运行逻辑
validator.py 参数校验

使用

创建一个 app 文件 app.py:

from CheeseAPI import CheeseAPI, Response

app = CheeseAPI()

@app.route.get('/')
async def index(**kwargs):
    return Response('这里是CheeseAPI!')

若在单文件中运行,继续添加入口即可

if __name__ == '__main__':
    app.run()

若在多文件项目中运行,可创建一个 manage.py 入口文件

from app import app

if __name__ == '__main__':
    app.run()

运行入口文件即可

示例

在 examples 目录下有一些示例项目,可以参考学习

文档

1. CheeseAPI(主模块)

2. Route(路由)

3. Request

4. Response

5. Websocket

6. File

7. Validator(数据校验)

8. Signal

9. Scheduler(任务调度)

Metadata

Release files for CheeseAPI 2.0.8b9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CheeseAPI 2.0.8b9
File Size Uploaded Provenance Actions
cheeseapi-2.0.8b9.tar.gz 32.0 kB Without provenance Details for cheeseapi-2.0.8b9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for CheeseAPI 2.0.8b9
File Interpreter ABI Platform Actions
cheeseapi-2.0.8b9-py2.py3-none-any.whl Python 2, Python 3 none any Details for cheeseapi-2.0.8b9-py2.py3-none-any.whl

Total release size: 70.2 kB

Release files / cheeseapi-2.0.8b9.tar.gz

Download URL cheeseapi-2.0.8b9.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
69b484e6fa97d7aaaa5fd3fafa406e092789bdab35fb1fa06c6df5d73c28ffd9
BLAKE2b-256 checksum
How to use checksums
a3a4a16d0ec61b7b7c3853e1a0b594d3eb023cef50eeedd8f0ac67ce266d5081
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / cheeseapi-2.0.8b9-py2.py3-none-any.whl

Download URL cheeseapi-2.0.8b9-py2.py3-none-any.whl
Size 38.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c2d744e9eab1193896142f535d1f679f31280080877c2c0451ded78234599563
BLAKE2b-256 checksum
How to use checksums
ba3d9b42483f6829cf47ae818c6b8a0fbdef953b4d613dcfac7d558e091ee19e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for CheeseAPI 2.0.8b9

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.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page