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.1rc5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c43d347e5681fac9bbea04d36dd16d69364720908a14f728a2016d59ed9a3d02 |
|
MD5 | 0c92d70bb1f97002408e0644ff48ea43 |
|
BLAKE2b-256 | c7f4391dcd8fc173d3404f9f31d3f06f0960c73a8c6cf9ff05ab8c5af770f239 |
Close
Hashes for surquest_fastapi_schemas-0.0.1rc5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58a6e612ef23ba192ff0b5ac935469adda1ee24b922f4c5dc4e8ba8388c65c4 |
|
MD5 | d6ab93eb095b0561e11b4b7cfc204677 |
|
BLAKE2b-256 | 69d2f4ee81a1b03cf0acb1121e2b5d2226f8d9f5a17e215ca0f07c17f0caa3e8 |