A FastAPI debug tool to look into request/response
Project description
FastAPI X-ray 🔥
This TUI is designed to streamline the debugging process by providing a comprehensive view of request/response data and tracking all executed SQL queries. This tool empowers developers to effectively diagnose and resolve issues related to database interactions.
Key Features:
-
Request/Response Data Debugging: Gain deep insights into the data exchanged between client applications and the server. Easily identify and analyze the content and structure of both incoming requests and outgoing responses.
-
SQL Query Tracking: Track every SQL query executed during the application runtime. Monitor query performance, detect bottlenecks, and optimize database interactions for enhanced efficiency.
Screenshots
Installation
Install this package from pypi using this command.
pip install fastapi_xray
Usage
It is very easy to use. Call the start_xray
function to start intercepting all the request and response.
from fastapi import FastAPI
from sqlalchemy import create_engine
from fastapi_xray import start_xray
# create SQLAlchemy engine
engine = create_engine("sqlite:///app.db")
app = FastAPI()
# Pass the instance of app and sql engine to the function.
# Passing the sql engine instance is optional
# if you are not using any database.
# NOTE: Not recommended to use it in the production.
if os.environ["DEBUG"]:
start_xray(app, engine)
Start the CLI to see the incoming requests in the terminal. Use this command to start the terminal interface.
fastapi_xray # starts the xray server at 8989 port
Use the --help
command to see all the configurable options.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fastapi_xray-0.1.0.tar.gz
.
File metadata
- Download URL: fastapi_xray-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9fe1ef8f8a426b25dde9f81191cac804b282b010d7e7584e027170333403a91 |
|
MD5 | 1544a974d121ed2ab7c27086eb7e95df |
|
BLAKE2b-256 | 91099169674fc67d73011a89ba9b28ae5215c73e4f6e2dbd608488f33620c1e8 |
File details
Details for the file fastapi_xray-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: fastapi_xray-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d96a7b7bf0511e5896c2624e80794b61ae60a8be4d81c87b59ec1ad2ef1344e2 |
|
MD5 | b726a54d15835fb90553586af00b79dd |
|
BLAKE2b-256 | ebbf90c995a97f52a0da4150fff3369bc68d3ce94cbbb38d677c7f5aa1e3aa6e |