fastapi-rest
Introduction
Fast restful API based on FastAPI and TortoiseORM.
Install
pip install fastapi-rest
Quick Start
First, define your ListView resource.
from fastapi_rest.resource import ListView
class UserList(ListView):
model = User
fields = ("name", "age")
Second, include router to your app.
app.include_router(UserList.as_router())
Now, you can visit the endpoint /user to get user list.
ListView
Export the endpoint GET /{resource}.
class ListView(Resource):
paginator: Paginator = Paginator()
fields: Optional[Tuple[str, ...]] = None
exclude: Optional[Tuple[str, ...]] = None
queryset: Optional[QuerySet] = None
query: Optional[Type[BaseModel]] = None
DetailView
Export the endpoint GET /{resource}/{pk}.
class DetailView(Resource):
fields: Optional[Tuple[str, ...]] = None
exclude: Optional[Tuple[str, ...]] = None
CreateView
Export the endpoint POST /{resource}.
class CreateView(Resource):
schema: Optional[Type[BaseModel]] = None
UpdateView
Export the endpoint PUT /{resource}/{pk}.
class UpdateView(Resource):
schema: Type[BaseModel]
DeleteView
Export the endpoint DELETE /{resource}/{pk}.
class DeleteView(Resource):
pass
Reference
You can see the examples here.
License
This project is licensed under the Apache2.0 License.
Metadata
Release files for fastapi-rest 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastapi-rest-0.1.1.tar.gz | 7.4 kB | Without provenance | Details for fastapi-rest-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastapi_rest-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for fastapi_rest-0.1.1-py3-none-any.whl |
Total release size: 20.0 kB
Release files / fastapi-rest-0.1.1.tar.gz
| Download URL | fastapi-rest-0.1.1.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c85cc2dc889ebddaa594a1aad4840e9445559f70c18e6a28a920643bd14ab482
|
|
BLAKE2b-256 checksum How to use checksums |
c978741df2d872ed73799bbc58f7444bd143cea17ce2752d862c62e301e3c26f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Release files / fastapi_rest-0.1.1-py3-none-any.whl
| Download URL | fastapi_rest-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47943005eb86eaa98c07f2026479e4225cbe8d0e817596aa8ef6ac94f345dd6f
|
|
BLAKE2b-256 checksum How to use checksums |
bf525ee0cac819299feb66e07fff2be09fbbe48ebcfb0f4857c91b2c898246e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Security for fastapi-rest 0.1.1
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.