{"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,"search_vec":"'0.3.11':32 'applic':10 'base':17 'debug':46 'execut':26 'frequenc':24 'inspect':20 'introspect':7,47 'latest':29 'librari':8 'low':41 'low-mainten':40 'mainten':42 'profil':5,44 'provid':13 'pypi':35 'queri':22 'releas':33 'sql':21 'sqlalchemi':12,45 'sqltap':1,2 'stabl':38 'status':43 'time':27 'ui':18 'use':11 'version':30 'web':16 'web-bas':15","created_at":"2026-05-01T08:14:11.719871+00:00","updated_at":"2026-05-01T08:14:11.719871+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.3.11","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/inconshreveable/sqltap","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sqltap/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}