This project provides collection of standard schemas for FastAPI framework as: startDate, endDate, offset, limit, etc.
Project description
Introduction
This project provides collection of commonly used schemas for FastAPI.
Quick Start
This section shows how to use the utilities provided by this project:
from fastapi import FastAPI
from surquest.fastapi.schemas.args import Args
app = FastAPI()
@app.get("/users")
async def get_users(
offset: Args.offset().type_ = Args.offset().query,
limit: Args.limit().type_ = Args.limit().query,
):
return [{
"id": 1,
"name": "John Doe"
}]
Local development
You are more than welcome to contribute to this project. To make your start easier we have prepared a docker image with all the necessary tools to run it as interpreter for Pycharm or to run tests.
Build docker image
docker build `
--tag surquest/fastapi/schemas `
--file package.base.dockerfile `
--target test .
Run tests
docker run --rm -it `
-v "${pwd}:/opt/project" `
-w "/opt/project/test" `
surquest/fastapi/schemas pytest
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for surquest_fastapi_schemas-0.0.1rc6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 994112787b705a2eb71963297c82a4c35101b0a1f40fa45759dee7163482260e |
|
MD5 | 4a6fe1193d16612d2eca5e04381c963f |
|
BLAKE2b-256 | 24841377cd437d43f3c7fc4058e490e955d52faf4da431043352b42d828f6d71 |
Close
Hashes for surquest_fastapi_schemas-0.0.1rc6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31cf90b8dd7f42ce1e46fefaae982d7cfc32c01c99f2a0d6be341df5814d667d |
|
MD5 | 1c71cbc0ab3779dbb874ab5b1264246a |
|
BLAKE2b-256 | 44d9b82c048bc1cb7f5e7a5a0e0c2f0d074f5755b8093384a4e66ac697b5dffb |