Skip to main content

Visualize a FastAPI dependency injection graph

Project description

FastAPI Dependency Injection Visualizer

This is a simple tool to visualize the dependency injection tree of a FastAPI application. It works by inspecting the FastAPI application and generating a graph of the dependencies from walking the dependency injection tree starting from the application's endpoints.

It automatically detects the endpoints and the dependencies of the application and generates a graph of the dependencies.

Usage

Install the package in the environment where your FastAPI application is installed.

pip install fastapi-di-viz

Then run the following command to generate the graph:

fastapi-di-viz your_app.main:app

A sample graph for the application in fastapi_di_viz/sample looks like this:

---
title: FastAPI dependency chain
---
graph TD;
    root --> get_settings
    a --> get_serviceA
    get_serviceA --> get_repo
    get_serviceA --> get_settings
    b --> get_serviceB
    get_serviceB --> get_repo

The tool supports graphs in the following formats:

  • Graphviz DOT format
  • Mermaid flowchart format

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

fastapi_di_viz-0.2.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

fastapi_di_viz-0.2.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_di_viz-0.2.0.tar.gz.

File metadata

  • Download URL: fastapi_di_viz-0.2.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastapi_di_viz-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7df972f3d4d0f2ec1a523a98c0cf76c385cdeb8d29789ce89162df10419c69eb
MD5 e4780067235646af28b831f52ebe2135
BLAKE2b-256 8890e7544c1212ba0cbb80dbdc605a6852c092fb34d339e0e587453bea233e87

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_di_viz-0.2.0.tar.gz:

Publisher: ci.yml on dotcs/fastapi-di-viz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_di_viz-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fastapi_di_viz-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastapi_di_viz-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 334f9a23fbbfd8dfd94be6f0fe65adb5f9ef002e2da24c952c1be683b3ead360
MD5 18771fce90fabb1278ca34b853a9b222
BLAKE2b-256 118cfbcb727944af34507dc54a880d4cb406a652afed5554656dde7d0bdb0f64

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_di_viz-0.2.0-py3-none-any.whl:

Publisher: ci.yml on dotcs/fastapi-di-viz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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