{"id":15044020,"url":"https://github.com/utilmeta/utilmeta-py","last_synced_at":"2025-05-16T09:04:43.651Z","repository":{"id":213118947,"uuid":"733086313","full_name":"utilmeta/utilmeta-py","owner":"utilmeta","description":"UtilMeta - progressive meta framework for API development in Python","archived":false,"fork":false,"pushed_at":"2025-04-07T13:02:44.000Z","size":2526,"stargazers_count":188,"open_issues_count":4,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-19T14:00:57.829Z","etag":null,"topics":["api","backend","declarative","django","fastapi","meta-framework","orm","restful-api","sanic","starlette","tornado"],"latest_commit_sha":null,"homepage":"https://utilmeta.com/py","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utilmeta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-18T14:30:55.000Z","updated_at":"2025-04-11T09:51:56.000Z","dependencies_parsed_at":"2023-12-18T15:51:44.397Z","dependency_job_id":"6e7ed244-0b7b-4ff1-a43b-cbfba326e227","html_url":"https://github.com/utilmeta/utilmeta-py","commit_stats":{"total_commits":74,"total_committers":2,"mean_commits":37.0,"dds":0.06756756756756754,"last_synced_commit":"b10fd92c867fad9ccd569c7dd9d251e86d79888e"},"previous_names":["utilmeta/utilmeta-py"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmeta%2Futilmeta-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmeta%2Futilmeta-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmeta%2Futilmeta-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmeta%2Futilmeta-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utilmeta","download_url":"https://codeload.github.com/utilmeta/utilmeta-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501557,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","declarative","django","fastapi","meta-framework","orm","restful-api","sanic","starlette","tornado"],"created_at":"2024-09-24T20:49:57.746Z","updated_at":"2025-05-16T09:04:38.636Z","avatar_url":"https://github.com/utilmeta.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# UtilMeta Python Framework\n\n\u003cimg src=\"https://utilmeta.com/img/logo-main-gradient.png\" style=\"width: 200px\" alt=\"\"\u003e\n\n**UtilMeta** Python framework is a progressive meta-framework to develop and manage backend applications, building declarative API \u0026 ORM efficiently based on the Python type annotation standard with both sync \u0026 async syntax, and supports using mainstream Python frameworks as runtime backend\n\n* Homepage: [https://utilmeta.com/py](https://utilmeta.com/py)\n* Documentation: [https://docs.utilmeta.com/py/en/](https://docs.utilmeta.com/py/en/)\n* Author: \u003ca href=\"https://github.com/voidZXL\" target=\"_blank\"\u003e@voidZXL\u003c/a\u003e\n* Language: [![en](https://img.shields.io/badge/lang-English-blue.svg)](https://github.com/utilmeta/utilmeta-py/blob/main/README.md) [![zh](https://img.shields.io/badge/lang-中文-green.svg)](https://github.com/utilmeta/utilmeta-py/blob/main/README.zh.md)\n\n\u003ca href=\"https://pypi.org/project/utilmeta/\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://img.shields.io/pypi/v/utilmeta\" alt=\"\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/utilmeta/\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://img.shields.io/pypi/pyversions/utilmeta\" alt=\"\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pepy.tech/project/utilmeta\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://pepy.tech/badge/utilmeta/month\" alt=\"\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/utilmeta/utilmeta-py/blob/main/LICENSE\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/license-Apache%202.0-blue\" alt=\"\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/utilmeta/utilmeta-py/actions?query=branch%3Amain+\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/utilmeta/utilmeta-py/test.yaml?branch=main\u0026label=CI\" alt=\"\"\u003e\n\u003c/a\u003e\n\n\n## Installation\n```\npip install utilmeta\n```\n\n\u003e UtilMeta requires Python \u003e= 3.8\n\n## Core Features\n\n### Declarative API \u0026 ORM\n\nwith UtilMeta, you can easily write declarative APIs with auto request validation, efficient ORM queries, and auto OpenAPI document generation, here is an example from [mini_blog/blog/api.py](https://github.com/utilmeta/utilmeta-py/blob/main/examples/mini_blog/blog/api.py)\n\n```python\nfrom utilmeta.core import api, orm\nfrom .models import User, Article\nfrom django.db import models\n\nclass UserSchema(orm.Schema[User]):\n    username: str\n    articles_num: int = models.Count('articles')\n\nclass ArticleSchema(orm.Schema[Article]):\n    id: int\n    author: UserSchema\n    content: str\n\nclass ArticleAPI(api.API):\n    async def get(self, id: int) -\u003e ArticleSchema:\n        return await ArticleSchema.ainit(id)\n```\n\nif you request the ArticleAPI like `GET /article?id=1`, you will get the result like\n\n```python\n{\n  \"id\": 1,\n  \"author\": {\n    \"username\": \"alice\",\n    \"articles_num\": 3\n  },\n  \"content\": \"hello world\"\n}\n```\nThis is just what you declared, UtilMeta will generate optimized ORM queries automatically based on your declared schemas, prevent N+1 problem and also generate OpenAPI document for your APIs\n\n### Progressive Meta Framework\nUtilMeta built a standard that support most major Python web frameworks as runtime backend, and support current projects using these frameworks to develop new API using UtilMeta progressively\n\nCurrently supported backends:\n\n* **Django** (also Django REST framework)\n* **Flask** (also APIFlask)\n* **FastAPI** (also Starlette)\n* **Sanic**\n* **Tornado**\n\nYou can change the entire runtime backend with a single line of code, Here is a hello world example of UtilMeta\n```python\nfrom utilmeta import UtilMeta\nfrom utilmeta.core import api\nimport django\n\nclass RootAPI(api.API):\n    @api.get\n    def hello(self):\n        return 'world'\n\nservice = UtilMeta(\n    __name__,\n    name='demo',\n    backend=django,    # or flask / fastapi / starlette / sanic / tornado\n    api=RootAPI,\n    route='/api'\n)\n\napp = service.application()  # wsgi app\n\nif __name__ == '__main__':\n    service.run()\n```\n\nYou can create a Python file with the above code and run it to check it out.\n\n## Quick Start\n\nyou can start by easily start by clone out repo and run an example \n\n```shell\npip install -U utilmeta\ngit clone https://github.com/utilmeta/utilmeta-py\ncd utilmeta-py/examples/mini_blog\nmeta migrate        # migrate databases\nmeta run            # or python server.py\n```\n\nThe following info Implies that the service has live\n```\n| UtilMeta (version) starting service [blog]\n|     version: 0.1.0\n|       stage: ● debug\n|     backend: fastapi (version) | asynchronous\n|    base url: http://127.0.0.1:8080\n```\n\n### Connect\nWhen you started your service, you can see a line of output\n```\nUtilMeta OperationsAPI loaded at http://127.0.0.1:8080/ops, connect your APIs at https://ops.utilmeta.com\n```\n\nthis indicates that UtilMeta Operations system is loaded successfully, you\nYou can connect your APIs by open this link: [https://ops.utilmeta.com/localhost?local_node=http://127.0.0.1:8080/ops](https://ops.utilmeta.com/localhost?local_node=http://127.0.0.1:8080/ops)\n\nClick **API** and your will see the generated API document, you can debug your API here\n\u003cimg src=\"https://utilmeta.com/assets/image/connect-local-api.png\" href=\"https://ops.utilmeta.com\" target=\"_blank\" width=\"800\"/\u003e\nWith your local API connected, you can use these features\n\n* **Data**: Manage database data (CRUD), in this example, you can add `user` and `article` instance\n* **API**: view and debug on auto generated API document\n* **Logs**: query realtime request logs, view request and response data, error tracebacks\n* **Servers**: view realtime metrics of service resources like servers, databases, caches\n\n\u003e Using other management features requires you to connect a online service with public network address\n## Document Guide\nWe have several introductory case tutorials from easy to complex, covering most usage of the framework. You can read and learn in the following order.\n\n1. [BMI Calculation API](https://docs.utilmeta.com/py/en/tutorials/bmi-calc)\n2. [User Login \u0026 RESTful API](https://docs.utilmeta.com/py/en/tutorials/user-auth)\n3. [Realworld Blog Project](https://docs.utilmeta.com/py/en/tutorials/realworld-blog)\n4. Websocket Chatroom (coming soon)\n\nIf you prefer to learn from a specific feature, you can refer to\n\n* [Handle Request](https://docs.utilmeta.com/py/en/guide/handle-request): How to handle path, query parameters, request body, file upload, request headers and cookies.\n* [API Class and Routing](https://docs.utilmeta.com/py/en/guide/api-route) How to use API class mounts to define tree-like API routing, and use  hooks to easily reuse code between APIs, handle errors, and template responses.\n* [Schema Query and ORM](https://docs.utilmeta.com/py/en/guide/schema-query) How to use UtilMeta to write declarative ORM queries for RESTful API.\n* [API Authentication](https://docs.utilmeta.com/py/en/guide/auth): How to use Session, JWT, OAuth and other methods to authenticate the request of the interface, get the current request's user and simplify the login operation\n* [Declarative Web Client](https://docs.utilmeta.com/py/en/guide/client): Use the declarative syntax identical to API to write request client code, and genrate client code based on UtilMeta service or OpenAPI docs\n\nIf your APIs are developed, and want to know how to config, run and manage your APis, check\n\n* [Config, Run \u0026 Deploy](https://docs.utilmeta.com/py/en/guide/config-run): How to configure the run settings, startup, and deployment of a service using features such as declarative environment variables\n* [Connect \u0026 Operations](https://docs.utilmeta.com/py/en/guide/ops): How to connect and manage your API service \n\n## Community\nJoin our community to build great things together\n\n* [Discord](https://discord.gg/JdmEkFS6dS)\n* [X(Twitter)](https://twitter.com/@utilmeta)\n* [Reddit](https://www.reddit.com/r/utilmeta)\n\n## Enterprise Solutions \u0026 Support\nThe UtilMeta team is providing custom solutions and enterprise-level support at\n\n* [https://utilmeta.com/solutions](https://utilmeta.com/solutions)\n\nYou can also contact us in [this page](https://utilmeta.com/about#contact)\n\n### Wechat\n\nContact the creator's wechat (voidZXL) for support or join the developers wechat group\n\n\u003cimg src=\"https://utilmeta.com/img/wx_voidzxl.jpg\" href=\"https://utilmeta.com/py\" target=\"_blank\"  alt=\"drawing\" width=\"200\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futilmeta%2Futilmeta-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futilmeta%2Futilmeta-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futilmeta%2Futilmeta-py/lists"}