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.1rc4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 299fc868a9e21637c264df7f5d4e5616b5ec0b338fe7050c9c1dc625daa4389d |
|
MD5 | 9044e05faf545bb1dbdc01da824263ca |
|
BLAKE2b-256 | da0fd6598a0878a8414081b674cb069f19320dafd92e75358277ee53e837a03f |
Close
Hashes for surquest_fastapi_schemas-0.0.1rc4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a334ca04d5d6aae8e8c6d8fe40f064fb22683d33a0a964afe7c5e879899f48aa |
|
MD5 | 1ab5ef0fe72be8292a968dde3007e4b1 |
|
BLAKE2b-256 | 8630e9065a0ba7ad58f928f1c6d24cfa99c958bfa77b16b5d9a6e91ac311a7b6 |