Skip to main content

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

image

image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_xray-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

fastapi_xray-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_xray-0.1.1.tar.gz.

File metadata

  • Download URL: fastapi_xray-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for fastapi_xray-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a49ffc2d040053cfaa87cd941579cb74836054e8d93f59ab3c1c2fd799a06f36
MD5 6a45a7212b9cace5e2d3e06b037938e3
BLAKE2b-256 e49fbcf565dd2fc485a247aff3abcd426da786bcb5499ccd2dd73cbfe427623e

See more details on using hashes here.

File details

Details for the file fastapi_xray-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fastapi_xray-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for fastapi_xray-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8814c58189df579e69c851a324034377531b7fe8eda8162ec6a981c3fed31220
MD5 62ed918f030c107c61b1e25fd3eab600
BLAKE2b-256 51e34225ecabd331d008f0968dda08e838fca1380039c409b80ec293df1b5a64

See more details on using hashes here.

Supported by

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