Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

pydantic-takibiapi

TakibiAPI with pydantic models as the schemas, checked strictly: constraints, unknown keys and responses included.

pip install pydantic-takibiapi

Quick start

from pydantic_takibiapi import Context, Model, TakibiAPI, createRoute


class Message(Model):
    message: str


class getTakibiRoute(
    createRoute(
        {
            "method": "get",
            "path": "/takibi",
            "responses": {200: {"description": "takibi🔥", "content": {"application/json": {"schema": Message}}}},
        }
    )
):
    """Say takibi🔥."""


def getTakibiRouteHandler(c: Context[getTakibiRoute]):
    return c.json(Message(message="takibi🔥"))


app = TakibiAPI()
app.openapi(getTakibiRoute, getTakibiRouteHandler)
app.doc("/doc", {"openapi": "3.1.0", "info": {"title": "takibi API", "version": "1.0.0"}})
granian --interface rsgi myapp:app   # or: uvicorn myapp:app
curl localhost:8000/takibi           # {"message":"takibi🔥"}

Import TakibiAPI from pydantic_takibiapi; everything else works as in Takibi.

Models

Every model, nested ones included, must be strict: subclass Model (a BaseModel with strict=True, extra="forbid"). app.openapi raises TypeError otherwise. Field constraints, aliases and validators work as in pydantic.

Checks

  • Requests: c.req.valid(...) gives a checked model instance. Path, query, header and cookie text is converted ("7" → 7); JSON bodies are strict ("1" is not an int) and reject unknown keys. A failure gets 422 with pydantic's error types as code.
  • Responses: c.json(value, status) checks value against the model declared for that status. A mismatch raises ResponseValidationError and answers 500 (details in the log, not in the response).
app.onError(lambda c: c.json({"error": str(c.error)}, 500))  # replaces the 500, ResponseValidationError included

OpenAPI

Schemas come from pydantic's JSON Schema; every model is a component (Name-Input / Name-Output when reading and writing differ). "3.0.x" documents are converted from it.

Development

From the repository root: uv run pytest packages/pydantic-takibiapi. See the root README.

License

Distributed under the MIT License. See LICENSE for more information.

Metadata

Release files for pydantic-takibiapi 0.1.1

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

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for pydantic-takibiapi 0.1.1
File Size Uploaded Provenance Actions
pydantic_takibiapi-0.1.1.tar.gz 7.7 kB With provenance Details for pydantic_takibiapi-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-takibiapi 0.1.1
File Interpreter ABI Platform Actions
pydantic_takibiapi-0.1.1-py3-none-any.whl Python 3 none any Details for pydantic_takibiapi-0.1.1-py3-none-any.whl

Total release size: 17.1 kB

Release files / pydantic_takibiapi-0.1.1.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL pydantic_takibiapi-0.1.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a7474f756c36c08597b0a4962df701eeb7fc20441723cd69e99586fa8289b0ac
BLAKE2b-256 checksum
How to use checksums
d30c87f79fdfc8483f1bde5b5aec33abe54085115461b2b58c8700dc06e12083
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / pydantic_takibiapi-0.1.1-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL pydantic_takibiapi-0.1.1-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
208b9385bfbde2f57e7fbe548c661bb6534e2cd94418be957ab4ea2ffee38614
BLAKE2b-256 checksum
How to use checksums
b0043e9382046251cad7a3b1b18616d6862323efb9c29e671782a41f4c2a87e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for pydantic-takibiapi 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for pydantic_takibiapi-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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