sqltap
Profiling and introspection for applications using sqlalchemy
What it is and what it does
sqltap is a profiling library that instruments SQLAlchemy to collect detailed metrics on every SQL query your application executes. It tracks how many times each query runs, how much time it takes, and where in your code it was issued from—giving you visibility into ORM inefficiencies that are easy to miss when working at a high level of abstraction.
You can use it as a standalone profiler (start, run queries, collect and report) or integrate it into WSGI applications via middleware to profile selectively in production. It generates reports in HTML or text format, and supports custom context functions to group statistics by request, page, or other application-level dimensions.
Use it for:
- Identify N+1 query problems in SQLAlchemy ORM code by seeing which queries execute repeatedly.
- Measure query execution time to find slow database operations causing application latency.
- Locate the source code lines issuing inefficient queries so you know exactly where to optimize.
- Profile a live WSGI application via the /__sqltap__ endpoint to diagnose production performance issues.
- Generate per-request or per-page query reports to understand query patterns across different application paths.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
sqltap hooks into SQLAlchemy to collect and report metrics on SQL queries—execution counts, timing, and call sites—helping you identify performance problems in ORM-heavy applications.
No. The package is abandoned (last release 2019, no maintenance since 2023) and has high install friction. Modern alternatives like SQLAlchemy's built-in event system, django-debug-toolbar (for Django), or sqlalchemy-utils provide similar profiling with active maintenance. Use sqltap only if you have legacy code already depending on it and cannot migrate.
Install
sqltap on PyPI
pip
pip install sqltapuv
uv add sqltappoetry
poetry add sqltapInstalling sqltap
Before you install
High install friction and abandoned maintenance status (last release 2019-05-03, no commits since 2023-05-31) mean this package is not actively maintained. It may not work with recent SQLAlchemy versions or modern Python releases without fixes.
License in practice
Licensed under Apache (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations.
Quickstart
import sqltap
profiler = sqltap.start()
# ... run your SQLAlchemy queries ...
statistics = profiler.collect()
sqltap.report(statistics, "report.html")
Requires SQLAlchemy to be installed separately; package has no declared runtime dependencies and may not be compatible with recent SQLAlchemy major versions.
Verify before relying
- Whether sqltap works with current SQLAlchemy versions (3.0+) or requires pinning to older releases.
- Python version compatibility beyond the unspecified classifier; whether it runs on Python 3.10+.
- Whether WSGI middleware integration still functions with modern web frameworks.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,660 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 150,070/month — #10,976 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sqltap-0.3.11.tar.gz
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
SQLAlchemySQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
opentelemetry-instrumentation-sqlalchemyAdds distributed tracing to SQLAlchemy database…
permissive · top 1,000 on PyPI
nplusoneDetects n+1 query problems in Python ORMs…
unclear · top 15,000 on PyPI
django-queryinspectDjango middleware that logs and reports SQL…
permissive · top 15,000 on PyPI
sqlbagsqlbag provides a collection of SQLAlchemy…
unclear · top 15,000 on PyPI
django-querycountDjango middleware that logs the number of…
permissive · top 15,000 on PyPI
Flask-SQLAlchemyFlask-SQLAlchemy integrates SQLAlchemy database…
permissive · top 1,000 on PyPI
google-cloud-sqlcommenterAutomatically injects metadata comments into…
permissive · top 15,000 on PyPI
sqlalchemy-mixinsProvides Active Record-style mixins for…
permissive · top 15,000 on PyPI
pyinstrumentPyinstrument is a statistical call-stack…
permissive · top 5,000 on PyPI