Skip to main content

pyramid_debugtoolbar_api_sqlalchemy

Build Status

pyramid_debugtoolbar_api_sqlalchemy extends the existing pyramid_debugtoolbar SQLAlchemy Panel to support downloadable CSV files of profiling data.

This package does not replace the default panel, and requires it to be active.

This package is designed for application profile and to be a useful part of test suites, allowing developers to run a series of tests and log the SQLAlchemy performance.

If you are using the debugtoolbar directly:

  • If SQLAlchemy queries exist on the request, a “SQLAlchemy CSV” tab will appear. That will prompt you for queries.

If you are scripting:

  • The urls are generated in a machine-friendly format, so you can regex the request_id off a page and pull it from the API. this is explained below:

NOTES:

This packages requires pyramid_debugtoolbar 4.0 or newer

How to use this package

Update your ENVIRONMENT.ini file

debugtoolbar.includes = pyramid_debugtoolbar_api_sqlalchemy

You MUST be using pyramid_debugtoolbar with the SQLAlchemy panel enabled. This just piggybacks on the existing module’s work to log queries.

You MUST use debugtoolbar.includes. This will not work properly via pyramid.includes

You can access a csv of the SQLAlchemy report via the following url hack:

url_html = '/_debug_toolbar/{request_id}'
url_api =  '/_debug_toolbar/api-sqlalchemy/sqlalchemy-{request_id}.csv'

The file will be downloaded and offer a content-disposition as:

sqlalchemy-{request_id}.csv

The CSV columns are:

  • execution timing

  • SQLAlchemy query

  • query params (json encoded)

Configuration

By default, this package writes CSV files using “UTF-8” encoding.

To change this, use the environment variable pyramid_debugtoolbar_api_sqlalchemy_encoding

export pyramid_debugtoolbar_api_sqlalchemy_encoding=ascii

Metadata

Release files for pyramid-debugtoolbar-api-sqlalchemy 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyramid-debugtoolbar-api-sqlalchemy 0.3.1
File Size Uploaded Provenance
pyramid_debugtoolbar_api_sqlalchemy-0.3.1.tar.gz 7.2 kB Without provenance Details

Release files / pyramid_debugtoolbar_api_sqlalchemy-0.3.1.tar.gz

Download URL pyramid_debugtoolbar_api_sqlalchemy-0.3.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8984c7f9fa22c5e1d896602182916b52ae3720640210257758cc400a98862d38
BLAKE2b-256 checksum
How to use checksums
2495a418a2003ca6789cf309178442e7e6ce5fc59a25e4ad054b115767c8afc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Security for pyramid-debugtoolbar-api-sqlalchemy 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page