{"id":13725030,"url":"https://github.com/pgjones/quart-schema","last_synced_at":"2025-05-16T19:03:50.710Z","repository":{"id":43169144,"uuid":"478699992","full_name":"pgjones/quart-schema","owner":"pgjones","description":"Quart-Schema is a Quart extension that provides schema validation and auto-generated API documentation.","archived":false,"fork":false,"pushed_at":"2025-04-21T15:30:41.000Z","size":301,"stargazers_count":92,"open_issues_count":15,"forks_count":24,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-21T16:34:54.241Z","etag":null,"topics":["quart"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgjones.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-06T19:30:51.000Z","updated_at":"2025-04-21T15:30:44.000Z","dependencies_parsed_at":"2024-05-20T21:12:08.089Z","dependency_job_id":"9dd62829-251f-436e-a0f4-b9dc76dc9fcd","html_url":"https://github.com/pgjones/quart-schema","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgjones","download_url":"https://codeload.github.com/pgjones/quart-schema/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254592367,"owners_count":22097010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["quart"],"created_at":"2024-08-03T01:02:10.331Z","updated_at":"2025-05-16T19:03:50.622Z","avatar_url":"https://github.com/pgjones.png","language":"Python","readme":"Quart-Schema\n============\n\n|Build Status| |docs| |pypi| |python| |license|\n\nQuart-Schema is a Quart extension that provides schema validation and\nauto-generated API documentation. This is particularly useful when\nwriting RESTful APIs.\n\nQuart-Schema can use either `msgspec\n\u003chttps://jcristharif.com/msgspec\u003e`_ or `pydantic\n\u003chttps://docs.pydantic.dev\u003e`_ to validate.\n\nQuickstart\n----------\n\nQuart-Schema can validate an existing Quart route by decorating it\nwith ``validate_querystring``, ``validate_request``, or\n``validate_response``. It can also validate the JSON data sent and\nreceived over websockets using the ``send_as`` and ``receive_as``\nmethods.\n\n.. code-block:: python\n\n    from dataclasses import dataclass\n    from datetime import datetime\n\n    from quart import Quart, websocket\n    from quart_schema import QuartSchema, validate_request, validate_response\n\n    app = Quart(__name__)\n    QuartSchema(app)\n\n    @dataclass\n    class Todo:\n        task: str\n        due: datetime | None\n\n    @app.post(\"/\")\n    @validate_request(Todo)\n    @validate_response(Todo, 201)\n    async def create_todo(data: Todo) -\u003e tuple[Todo, int]:\n        ... # Do something with data, e.g. save to the DB\n        return data, 201\n\n    @app.websocket(\"/ws\")\n    async def ws() -\u003e None:\n        while True:\n            data = await websocket.receive_as(Todo)\n            ... # Do something with data, e.g. save to the DB\n            await websocket.send_as(data, Todo)\n\nThe documentation is served by default at ``/openapi.json`` according\nto the OpenAPI standard, or at ``/docs`` for a `SwaggerUI\n\u003chttps://swagger.io/tools/swagger-ui/\u003e`_ interface, or ``/redocs`` for\na `redoc \u003chttps://github.com/Redocly/redoc\u003e`_ interface, or\n``/scalar`` for a `Scalar \u003chttps://github.com/scalar/scalar\u003e`_\ninterface. Note that there is currently no documentation standard for\nWebSockets.\n\nContributing\n------------\n\nQuart-Schema is developed on `GitHub\n\u003chttps://github.com/pgjones/quart-schema\u003e`_. If you come across an\nissue, or have a feature request please open an `issue\n\u003chttps://github.com/pgjones/quart-schema/issues\u003e`_. If you want to\ncontribute a fix or the feature-implementation please do (typo fixes\nwelcome), by proposing a `merge request\n\u003chttps://github.com/pgjones/quart-schema/merge_requests\u003e`_.\n\nTesting\n~~~~~~~\n\nThe best way to test Quart-Schema is with `Tox\n\u003chttps://tox.readthedocs.io\u003e`_,\n\n.. code-block:: console\n\n    $ pip install tox\n    $ tox\n\nthis will check the code style and run the tests.\n\nHelp\n----\n\nThe Quart-Schema `documentation\n\u003chttps://quart-schema.readthedocs.io\u003e`_ is the best places to\nstart, after that try searching `stack overflow\n\u003chttps://stackoverflow.com/questions/tagged/quart\u003e`_ or ask for help\n`on gitter \u003chttps://gitter.im/python-quart/lobby\u003e`_. If you still\ncan't find an answer please `open an issue\n\u003chttps://github.com/pgjones/quart-schema/issues\u003e`_.\n\n\n.. |Build Status| image:: https://github.com/pgjones/quart-schema/actions/workflows/ci.yml/badge.svg\n   :target: https://github.com/pgjones/quart-schema/commits/main\n\n.. |docs| image:: https://img.shields.io/badge/docs-passing-brightgreen.svg\n   :target: https://quart-schema.readthedocs.io\n\n.. |pypi| image:: https://img.shields.io/pypi/v/quart-schema.svg\n   :target: https://pypi.python.org/pypi/Quart-Schema/\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/quart-schema.svg\n   :target: https://pypi.python.org/pypi/Quart-Schema/\n\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: https://github.com/pgjones/quart-schema/blob/main/LICENSE\n","funding_links":[],"categories":["Python","Web"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgjones%2Fquart-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgjones%2Fquart-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgjones%2Fquart-schema/lists"}