Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【开源自荐】UtilMeta | 极简高效的 Python 后端元框架 #403

Open
voidZXL opened this issue Jan 27, 2024 · 0 comments
Open

【开源自荐】UtilMeta | 极简高效的 Python 后端元框架 #403

voidZXL opened this issue Jan 27, 2024 · 0 comments

Comments

@voidZXL
Copy link

voidZXL commented Jan 27, 2024

  • 项目地址:https://github.com/utilmeta/utilmeta-py

  • 项目标题:UtilMeta | 极简高效的 Python 后端元框架

  • 项目描述:
    UtilMeta 是一个用于开发 API 服务的后端元框架,基于 Python 类型注解标准高效构建声明式接口与 ORM 查询,能够自动解析请求参数与生成 OpenAPI 文档,高效开发 RESTful 接口,产出的代码简洁清晰,并且支持使用主流 Python 框架(django, flask, fastapi, starlette, sanic, tornado 等)作为运行时实现或渐进式整合
    框架主页
    快速开始
    案例教程

  • 亮点:

    • UtilMeta 的声明式 ORM 能高效处理大部分 CRUD 场景,what you define is what you get,自动规避 N+1 关系查询问题,简洁高效
    • UtilMeta 可以使用主流的 Python 框架作为运行时实现,仅需一个参数即可切换整个底层实现,你也可以从现有项目渐进式地集成
    • UtilMeta 配套了一个全周期的 API 管理平台,可以一站式解决小团队的接口文档调试,日志查询,服务器监控,报警通知与事件管理等运维与管理需求
  • 示例代码:

from utilmeta.core import api, orm
from django.db import models
from .models import User, Article

class UserSchema(orm.Schema[User]):
    username: str
    articles_num: int = models.Count('articles')

class ArticleSchema(orm.Schema[Article]):
    id: int
    author: UserSchema
    content: str

class ArticleAPI(api.API):
    async def get(self, id: int) -> ArticleSchema:
        return await ArticleSchema.ainit(id)
  • 截图:

image

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant