Welcome to FastAPI-Toolbar
Original work: https://github.com/mongkok/fastapi-debug-toolbar
Installation
pip install fastapi-toolbar
Quickstart
Add DebugToolbarMiddleware middleware to your FastAPI application:
from debug_toolbar.middleware import DebugToolbarMiddleware
from fastapi import FastAPI
app = FastAPI(debug=True)
app.add_middleware(DebugToolbarMiddleware)
SQLAlchemy
Please make sure to use the "Dependency Injection" system as described in the FastAPI docs and add the SQLAlchemyPanel to your panel list:
If you're using a database session generator (using yield), please add the full python path of your generators
on the session_generators options, when adding the middleware:
# database.py
from typing import Generator
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
SessionLocal = sessionmaker(bind=engine)
Base = declarative_base()
Base.metadata.create_all(bind=engine)
def get_db() -> Generator:
db = SessionLocal()
try:
yield db
finally:
db.close() # sqlite will drop tables in memory
Base.metadata.create_all(bind=engine) # create tables again
# app.py
from fastapi import FastAPI
from debug_toolbar.middleware import DebugToolbarMiddleware
app = FastAPI()
app.add_middleware(
DebugToolbarMiddleware,
panels=["debug_toolbar.panels.sqlalchemy.SQLAlchemyPanel"],
session_generators=["database:get_db"] # Add the full python path of your session generators
)
Tortoise ORM
Add the TortoisePanel to your panel list:
from fastapi import FastAPI
from debug_toolbar.middleware import DebugToolbarMiddleware
app = FastAPI()
app.add_middleware(
DebugToolbarMiddleware,
panels=["debug_toolbar.panels.tortoise.TortoisePanel"],
)
Metadata
Release files for fastapi-toolbar 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastapi-toolbar-1.0.3.tar.gz | 31.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_toolbar-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.8 kB
Release files / fastapi-toolbar-1.0.3.tar.gz
| Download URL | fastapi-toolbar-1.0.3.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
633048ba1166726774bb6c6efa40a2ea584f5d0897d2bcb77e3ecee7d6f7b87b
|
|
BLAKE2b-256 checksum How to use checksums |
94e53573a50272f6318d171f6fe2d172d3bb2e36280e47a631a9b93d4f71372f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Release files / fastapi_toolbar-1.0.3-py3-none-any.whl
| Download URL | fastapi_toolbar-1.0.3-py3-none-any.whl |
|---|---|
| Size | 47.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cabae7da6739aa5bda86ba8db860907f637f64f7f4e01dff52bfec1dc9c80174
|
|
BLAKE2b-256 checksum How to use checksums |
a528b7c6d2d50f7074cad5c9188c39c12e61f1b2407bc7484186b2a778f2d87b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Security for fastapi-toolbar 1.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.