Skip to main content

This project provides collection of standard schemas for FastAPI framework as: startDate, endDate, offset, limit, etc.

Project description

GitHub GitHub Workflow Status (with branch) Coverage PyPI - Downloads PyPI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

surquest_fastapi_schemas-0.0.1rc10.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

surquest_fastapi_schemas-0.0.1rc10-py2.py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page