The easiest way to create your Restful CRUD APIs
Project description
CrudAPI: The easiest way to create your CRUD APIs
Combining the power of FastAPI, Pydantic and SQLAlchemy, you'll only have to care about modeling your data and we'll take care of building up a RESTful API for it.
from crudapi import CrudAPI
from crudapi.models.api import BaseAPI
from crudapi.models.orm import BaseORM
from sqlalchemy import Column
from sqlalchemy import String
class BookORM(BaseORM):
__tablename__ = "books"
title = Column(String, nullable=False)
crud = CrudAPI(orm_model=BookORM)
you'll get, out of the box, a working crudapi with all these working REST endpoints:
- GET: /books
- POST: /books
- GET: /books/<id>
- PUT: /books/<id>
- PATCH: /books/<id>
- DELETE: /books/<id>
and because CrudAPI subclasses FastAPI you'll also get all the incredible features of this wonderful library.
Development
We use Poetry for packaging and dependency management:
poetry install
poetry shell
We use Pytest for testing:
pytest
You can start a testing server running:
uvicorn tests.server:app --reload
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file crudapi-0.1.1.tar.gz
.
File metadata
- Download URL: crudapi-0.1.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.4.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e52d0aedbec6a380b1681ee3b8939de811e476e5c2e3ed9315664db19a61aa66 |
|
MD5 | b10152e626cb429c258203b0af423780 |
|
BLAKE2b-256 | 8c94bbc851cfdf46d91d041d4d32bc3a28d1261e95a7372080648a409413f816 |
File details
Details for the file crudapi-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: crudapi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.4.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a42fe311dcfeae9b7e97158c139d08c8788368702dd7d8bb1ed2e033c63b228f |
|
MD5 | f60a2f1858e9b23cdb725af62cfc2506 |
|
BLAKE2b-256 | 69a2d0d79f0e769ea456f639996f4cff0e00c611f3cbb44f17883e30f385102c |