{"id":24647,"library":"sqltap","title":"sqltap","description":"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.","status":"active","version":"0.3.11","language":"python","source_language":"en","source_url":"https://github.com/inconshreveable/sqltap","tags":["profiling","sqlalchemy","debugging","introspection"],"install":[{"cmd":"pip install sqltap","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"sqltap profiles SQLAlchemy applications","package":"sqlalchemy","optional":false},{"reason":"Used for rendering the profiling HTML UI","package":"jinja2","optional":false},{"reason":"Optional web server for the UI","package":"flask","optional":true}],"imports":[{"note":"sqltap is a module, not a class. Common mistake is to treat it as a nested import.","wrong":"from sqltap import sqltap","symbol":"sqltap","correct":"import sqltap"}],"quickstart":{"code":"import sqltap\nfrom sqlalchemy import create_engine\n\nengine = create_engine('sqlite:///:memory:')\nprofiler = sqltap.start()\n# run your SQLAlchemy queries here\nengine.execute('SELECT 1')\nstatistics = sqltap.stop(profiler)\nsqltap.report(statistics, \"report.html\")","lang":"python","description":"Profile SQLAlchemy queries by wrapping code with sqltap.start() and sqltap.stop(), then generate an HTML report."},"warnings":[{"fix":"Always capture the return value of sqltap.start() and pass it to sqltap.stop().","message":"sqltap.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.","severity":"gotcha","affected_versions":"all"},{"fix":"Install Flask: pip install flask","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider alternative profiling tools like sqlalchemy event listeners or APM solutions.","message":"sqltap 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.","severity":"deprecated","affected_versions":"0.3.11"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install sqltap","cause":"sqltap is not installed or the environment is incorrect.","error":"ModuleNotFoundError: No module named 'sqltap'"},{"fix":"Use `import sqltap` then `sqltap.start()`.","cause":"Wrong import pattern: importing sqltap incorrectly (e.g., from sqltap import sqltap) leads to missing attributes.","error":"AttributeError: module 'sqltap' has no attribute 'start'"},{"fix":"pip install flask","cause":"sqltap.report() tries to use Flask/Jinja2 internally; without Flask, it raises an ImportError.","error":"Report generation fails with 'No module named flask'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}