{"id":15658513,"url":"https://github.com/long2ice/fastapi-rest","last_synced_at":"2025-10-07T08:32:56.631Z","repository":{"id":37674270,"uuid":"381061273","full_name":"long2ice/fastapi-rest","owner":"long2ice","description":"Fast restful API based on FastAPI and TortoiseORM","archived":false,"fork":false,"pushed_at":"2021-06-30T15:32:56.000Z","size":34,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T03:22:08.853Z","etag":null,"topics":["fastapi","rest","rest-api","restful-api","tortoise-orm"],"latest_commit_sha":null,"homepage":"https://github.com/long2ice/fastapi-rest","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/long2ice.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-28T14:32:05.000Z","updated_at":"2023-06-25T14:49:22.000Z","dependencies_parsed_at":"2022-09-15T08:52:14.118Z","dependency_job_id":null,"html_url":"https://github.com/long2ice/fastapi-rest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long2ice%2Ffastapi-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long2ice%2Ffastapi-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long2ice%2Ffastapi-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long2ice%2Ffastapi-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/long2ice","download_url":"https://codeload.github.com/long2ice/fastapi-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235609070,"owners_count":19017636,"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":["fastapi","rest","rest-api","restful-api","tortoise-orm"],"created_at":"2024-10-03T13:12:42.547Z","updated_at":"2025-10-07T08:32:51.358Z","avatar_url":"https://github.com/long2ice.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-rest\n\n[![image](https://img.shields.io/pypi/v/fastapi-rest.svg?style=flat)](https://pypi.python.org/pypi/fastapi-rest)\n[![image](https://img.shields.io/github/license/long2ice/fastapi-rest)](https://github.com/long2ice/fastapi-rest)\n[![image](https://github.com/long2ice/fastapi-rest/workflows/pypi/badge.svg)](https://github.com/long2ice/fastapi-rest/actions?query=workflow:pypi)\n[![image](https://github.com/long2ice/fastapi-rest/workflows/ci/badge.svg)](https://github.com/long2ice/fastapi-rest/actions?query=workflow:ci)\n\n## Introduction\n\nFast restful API based on FastAPI and TortoiseORM.\n\n## Install\n\n```shell\npip install fastapi-rest\n```\n\n## Quick Start\n\nFirst, define your `ListView` resource.\n\n```python\nfrom fastapi_rest.resource import ListView\n\n\nclass UserList(ListView):\n    model = User\n    fields = (\"name\", \"age\")\n```\n\nSecond, include router to your app.\n\n```python\napp.include_router(UserList.as_router())\n```\n\nNow, you can visit the endpoint `/user` to get user list.\n\n### ListView\n\nExport the endpoint `GET /{resource}`.\n\n```python\nclass ListView(Resource):\n    paginator: Paginator = Paginator()\n    fields: Optional[Tuple[str, ...]] = None\n    exclude: Optional[Tuple[str, ...]] = None\n    queryset: Optional[QuerySet] = None\n    query: Optional[Type[BaseModel]] = None\n```\n\n### DetailView\n\nExport the endpoint `GET /{resource}/{pk}`.\n\n```python\nclass DetailView(Resource):\n    fields: Optional[Tuple[str, ...]] = None\n    exclude: Optional[Tuple[str, ...]] = None\n```\n\n### CreateView\n\nExport the endpoint `POST /{resource}`.\n\n```python\nclass CreateView(Resource):\n    schema: Optional[Type[BaseModel]] = None\n```\n\n### UpdateView\n\nExport the endpoint `PUT /{resource}/{pk}`.\n\n```python\nclass UpdateView(Resource):\n    schema: Type[BaseModel]\n```\n\n### DeleteView\n\nExport the endpoint `DELETE /{resource}/{pk}`.\n\n```python\nclass DeleteView(Resource):\n    pass\n```\n\n## Reference\n\nYou can see the examples [here](./examples).\n\n## License\n\nThis project is licensed under the [Apache2.0](https://github.com/long2ice/fastapi-rest/blob/master/LICENSE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flong2ice%2Ffastapi-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flong2ice%2Ffastapi-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flong2ice%2Ffastapi-rest/lists"}