Skip to main content

Griffe extension for FastAPI.

Project description

Griffe FastAPI Extension

This extension will search for functions that are decorated with an APIRouter and adds the following extra fields to a function:

  • api: the path of the api
  • method: the HTTP method
  • responses: A dictionary with the responses

These fields are stored in the extra property of the function. The extra property is a dictionary and griffe_fastapi is the key for the fields of this extension.

A fastapi template is used to handle these extra fields in your documentation.

Installation

pip install griffe-fastapi

or with poetry:

poetry add griffe-fastapi -G docs

When you use a group, like above, you also need to install it:

poetry install -G docs

MkDocs

plugins:
- mkdocstrings:
    handlers:
      python:
        options:
          extensions:
          - griffe_fastapi

Configuration

  • paths select only apply griffe-fastapi for the given paths
  • generate_table Add a table in the docstring with the http response codes (default=True)

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

griffe_fastapi-0.1.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

griffe_fastapi-0.1.6-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file griffe_fastapi-0.1.6.tar.gz.

File metadata

  • Download URL: griffe_fastapi-0.1.6.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.0 CPython/3.10.12 Linux/6.8.0-90-generic

File hashes

Hashes for griffe_fastapi-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7b8525d51a8bc0340b88b3fde5f83d1192eacfb21a8ed2b71dd6f53edc352b21
MD5 dc72a76ef52efcfdb955f5e9c10e5223
BLAKE2b-256 b1bf64d826105dc4b49c608ea27681af7be8c8fd8d94df3143727046461e6f84

See more details on using hashes here.

File details

Details for the file griffe_fastapi-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: griffe_fastapi-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.0 CPython/3.10.12 Linux/6.8.0-90-generic

File hashes

Hashes for griffe_fastapi-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6f163fd64e266520f0f34a09419b5977d6716467bdac5854fa69e28aa6745428
MD5 9800fb4023f6a177dde83a6a9d829617
BLAKE2b-256 0c00fadd215815365699e71effda1850b06de186486091dbd9b7cce5f25b7831

See more details on using hashes here.

Supported by

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