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.1rc3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18401e829fd094bc908b5d68b68c24410ad34d3253dfff37812d5bcab55f79ca |
|
MD5 | 88561021a396309818ba583901126b4c |
|
BLAKE2b-256 | c6e5854342b4a0e95fd040402720a312fa352010ba0143c8503cf22b5b88cd76 |
Close
Hashes for surquest_fastapi_schemas-0.0.1rc3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c854a5b5a156e24ea75acfd637a3097a13aba642c49de4bfa2fe09626a7413d8 |
|
MD5 | e93e7f3e06433a266c45ffe50c05b5fa |
|
BLAKE2b-256 | 2720f8cc401423ec5be400a9d437a2f5aa6b0b0a30cbdbd7384374a38235b026 |