Skip to main content

Classic Falcon Integration

Предоставляет простую интеграцию веб-фреймворка Falcon, orjson и classic-error-handling.

Установка

pip install classic-falcon-integration

Quickstart

from falcon import App, Request, Response
from pydantic import BaseModel
import waitress

from classic.components import component
from classic.falcon_integration import register_all
from classic import db_tools


class Pet(BaseModel):
    id: int
    name: str
    age: int


class FilterPets(BaseModel):
    name__contains: list[str] | None = None
    age__le: int | None = None
    age__gt: int | None = None
    id: int | None = None


class NewPet(BaseModel):
    name: str
    age: int


@component
class PetsResource:
    db: db_tools.Engine

    def on_get(self, request: Request, response: Response):
        # Валидация по спецификации отключена по умолчанию,
        # потому вызов валидации обязательно добавлять вручную.
        # Валидацию лучше сего проводить через model_validate,
        # так как далее данные все равно будут переданы в виде dict
        FilterPets.model_validate(request.params)

        # Здесь приведен пример работы с БД с classic-db-tools,
        # но здесь может быть что угодно
        with self.db:
            response.media = self.db.queries.filter_pets(
                **request.params
            ).return_as(
                db_tools.ToCls(Pet, id='id'),
                returns=Pet,
            ).many()

    def on_post(self, request: Request, response: Response):
        NewPet.model_validate(request.media)
        with self.db:
            response.media = self.db.queries.save_pet(
                **request.media,
            )


if __name__ == '__main__':
    app = App()
    app.add_route('/api/pets', PetsResource())
    register_all(app)

    waitress.serve(
        app,
        host='127.0.0.1',
        port='8000',
    )

Metadata

Release files for classic-falcon-integration 2.0.1

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

Source distribution (sdist)

Source distribution for classic-falcon-integration 2.0.1
File Size Uploaded Provenance
classic_falcon_integration-2.0.1.tar.gz 4.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for classic-falcon-integration 2.0.1
File Interpreter ABI Platform
classic_falcon_integration-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / classic_falcon_integration-2.0.1.tar.gz

Download URL classic_falcon_integration-2.0.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0306c65469258ba834c97d67fbdc0b3f0dda6c8c327980fe51dab9902c6f33fa
BLAKE2b-256 checksum
How to use checksums
03d32f383c5fc7d0871a5253334d4ffd024218518a2290676614502a1cd368cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 15, 2026.

Transparency log

Release files / classic_falcon_integration-2.0.1-py3-none-any.whl

Download URL classic_falcon_integration-2.0.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eecb8482a5d3dd4c3fb8959d21434454212e028e26bac7216cae328eef30375f
BLAKE2b-256 checksum
How to use checksums
7c8454a3b47e5bb828fea035c178d92cf740190dbfc02fd3c7903b18150bd33b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 15, 2026.

Transparency log

Security for classic-falcon-integration 2.0.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for classic_falcon_integration-2.0.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 Apr 15, 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