Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyfa-converter-v2

Allows you to convert Pydantic models for FastAPI param models - query, form, header, cookie, body, etc.

The project is originally written by dotX12 at dotX12/pyfa-converter, but it doesn't support Pydantic v2, so we made a fork of the project with some changes:

  • Added support for pydantic v2
  • Added tests
  • Re-licensed the code to LGPL 3.0
  • Added mypy, flake8, isort checks
  • Removed dead code

The project may be archived if the original package author upgrades to Pydantic v2 (dotX12/pyfa-converter#25).

Currently, the library does not fully reflect the requirements in OpenAPI (e.g. gt parameter will be required, but this will not be specified in FastAPI docs).

How to install?

pip install pyfa_converter_v2

How to simplify your life?

from fastapi import FastAPI
from pydantic import BaseModel

from pyfa_converter_v2 import QueryDepends

app = FastAPI()

class ArticleSchema(BaseModel):
    title: str
    content: str

@app.post("/article")
async def create_article(article: ArticleSchema = QueryDepends(ArticleSchema)):
    return {"id": 1, "title": article.title, "content": article.content}

Release files for pyfa-converter-v2 2.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfa-converter-v2 2.0.0rc1
File Size Uploaded
pyfa_converter_v2-2.0.0rc1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfa-converter-v2 2.0.0rc1
File Interpreter ABI Platform
pyfa_converter_v2-2.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / pyfa_converter_v2-2.0.0rc1.tar.gz

Download URL pyfa_converter_v2-2.0.0rc1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d505466b29a90d6d7455b3efa77d77eaefa49dcd506670756685d15d5f439843
BLAKE2b-256 checksum
How to use checksums
096487694101871ce7b4a1bd77a7d0dbf6ef9a361945cfac78a6659d94faa9ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.8.18 Linux/6.5.9-300.fc39.x86_64

Release files / pyfa_converter_v2-2.0.0rc1-py3-none-any.whl

Download URL pyfa_converter_v2-2.0.0rc1-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
575469d88b3917ff3464b145ae437efb499cbc8dd105733f045846747661e561
BLAKE2b-256 checksum
How to use checksums
d151a3096c63725d652056c71f82d2fef2ab658b5bc9662cbe9362bb37c2d015
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.8.18 Linux/6.5.9-300.fc39.x86_64

Release history Release notifications | RSS feed

This release

2.0.0rc1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page