Registry / database / sqltap

sqltap

JSON →
library0.3.11pypypi✓ verified 84d ago

sqltap is a profiling and introspection library for applications using SQLAlchemy, providing a web-based UI to inspect SQL queries, their frequency, and execution time. The latest version is 0.3.11, released on PyPI with a stable but low-maintenance status.

pip install sqltap
INSTALL
IMPORT
SIG · SQLTAP
S
sqltap
databasepythonv0.3.11
Install
4.7s avg
Import
770ms
Disk
45MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.782s · 47.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.7s · import 0.758s · 45MB
45MB installed
● package 45MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sqltap
import sqltap
from sqltap import sqltap
sqltap is a module, not a class. Common mistake is to treat it as a nested import.

Profile SQLAlchemy queries by wrapping code with sqltap.start() and sqltap.stop(), then generate an HTML report.

import sqltap from sqlalchemy import create_engine engine = create_engine('sqlite:///:memory:') profiler = sqltap.start() # run your SQLAlchemy queries here engine.execute('SELECT 1') statistics = sqltap.stop(profiler) sqltap.report(statistics, "report.html")
Debug
Known issues
gotchasqltap.start() returns a profiler object that must be passed to sqltap.stop() - if you forget the return value and use None, the profiler won't be stopped correctly.
fix
Always capture the return value of sqltap.start() and pass it to sqltap.stop().
affects: all
gotchaThe HTML report uses Flask/Jinja2 templates; if you do not have Flask installed, the report generation may fail. Make sure to install Flask or handle the exception.
fix
Install Flask: pip install flask
affects: all
deprecatedsqltap has not seen updates in several years and may be incompatible with newer SQLAlchemy versions (e.g., 2.0+). The last release was 0.3.11 in 2016.
fix
Consider alternative profiling tools like sqlalchemy event listeners or APM solutions.
affects: 0.3.11
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'sqltap'
sqltap is not installed or the environment is incorrect.
fix
pip install sqltap
AttributeError: module 'sqltap' has no attribute 'start'
Wrong import pattern: importing sqltap incorrectly (e.g., from sqltap import sqltap) leads to missing attributes.
fix
Use `import sqltap` then `sqltap.start()`.
Report generation fails with 'No module named flask'
sqltap.report() tries to use Flask/Jinja2 internally; without Flask, it raises an ImportError.
fix
pip install flask
Upgrade
Version history
0.3.11latest on PyPI · released May 3, 2019
Audit
Dependencies
sqlalchemyrequiredsqltap profiles SQLAlchemy applications
jinja2requiredUsed for rendering the profiling HTML UI
flaskoptionalOptional web server for the UI
Agent activity
31 hits · last 30 days
node
28
OpenAI (training)
1
Resources
sqltap — pip install sqltap · libregistry