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.1rc8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b57039f40a79bb7ce3a2f55550d0d784f2984bb44476fff3cd940d837775e818 |
|
MD5 | 8617d7cf722776ec3a6f08eac179d176 |
|
BLAKE2b-256 | e46d1779b86cc3a14858884566cf65c232870f50953b3b4b6d1b7aa2dfa2abd5 |
Close
Hashes for surquest_fastapi_schemas-0.0.1rc8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02f24f2be5ce1dd2a7848dbe12576950472c05b0a35a91ee319e2b546676f3ca |
|
MD5 | 3e1566df4fd105dc9d1418bf7d76fdb0 |
|
BLAKE2b-256 | 33f471a483fc186db2a026923ee4ed32d7d540be1bcd995ae3f9274cfc27131a |