skillfed

sqltap

Profiling and introspection for applications using sqlalchemy

sqltap v0.3.11 150.1K downloads/30d#10,976 on PyPI360
Permissive license Abandoned released

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 sqltap

uv

uv add sqltap

poetry

poetry add sqltap

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Database

Tags

sqlalchemy query profilingsql performance monitoringdatabase query metricssqlalchemy debuggingsql execution trackingorm query analysissql slowness detection
profilingsqlalchemyabandoned

More Database packages