This release is a pre-release and may not be stable for production use.
datasette-debug-bar
A generic debug bar for Datasette that other plugins can add items to. The bar is fixed to the bottom-right corner of every page and can be minimized/expanded (state persists in localStorage).
Installation
datasette install datasette-debug-bar
Writing a debug-bar plugin
Any Datasette plugin can add a section to the debug bar by defining a debug_bar_items function at the top level of its module.
API
def debug_bar_items(datasette):
return {
"label": "My Section",
"entrypoint": """function(el) {
// el is an empty HTMLElement — append your UI to it
el.textContent = 'Hello from my plugin!';
}""",
}
| Key | Type | Description |
|---|---|---|
label |
str |
Heading displayed above the section in the bar. |
entrypoint |
str |
A JavaScript function body as a string. It receives a single argument el (an HTMLElement). Append whatever DOM you want to el. |
You can return a single dict or a list of dicts to register multiple sections.
Complete example
Here is a minimal but complete Datasette plugin that adds a "Request Info" section to the debug bar. This is a single Python file that can be used directly with datasette --plugins-dir.
# debug_request_info.py
def debug_bar_items(datasette):
return {
"label": "Request Info",
"entrypoint": """function(el) {
var items = [
['Path', location.pathname],
['Query', location.search || '(none)'],
['Hash', location.hash || '(none)'],
];
var table = document.createElement('table');
table.style.cssText = 'border-collapse:collapse;font-size:12px;width:100%;';
items.forEach(function(row) {
var tr = document.createElement('tr');
var td1 = document.createElement('td');
td1.textContent = row[0];
td1.style.cssText = 'padding:2px 8px 2px 0;color:#666;white-space:nowrap;';
var td2 = document.createElement('td');
td2.textContent = row[1];
td2.style.cssText = 'padding:2px 0;font-family:monospace;word-break:break-all;';
tr.appendChild(td1);
tr.appendChild(td2);
table.appendChild(tr);
});
el.appendChild(table);
}""",
}
Using it as a package
For installable plugins, add datasette-debug-bar as a dependency in your pyproject.toml:
[project]
dependencies = [
"datasette",
"datasette-debug-bar",
]
[project.entry-points.datasette]
my_debug_plugin = "my_debug_plugin"
Then define debug_bar_items in your package's __init__.py. The function will be discovered automatically when both plugins are installed.
Entrypoint tips
- The
elargument is a<div>inside the bar panel. Append DOM nodes to it. - The function runs once on page load. If you need live updates, use
setIntervalor event listeners inside the function. - You have access to the full browser environment:
document,window,fetch,localStorage,location, cookies, etc. - Keep the UI compact — the bar is meant for quick-glance debugging info.
Sample plugins
The sample/ directory contains two working example plugins that can be used with --plugins-dir:
debug_request_info.py— displays current URL path, query string, and hashdebug_performance.py— displays page performance timing (DNS, connect, response, DOM ready, load, transfer size)
Run them:
DATASETTE_SECRET=abc123 datasette --plugins-dir sample
Development
cd datasette-debug-bar
# Run tests
uv run pytest
# Run dev server with sample plugins
just dev
Metadata
Release files for datasette-debug-bar 0.0.1a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datasette_debug_bar-0.0.1a1.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasette_debug_bar-0.0.1a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / datasette_debug_bar-0.0.1a1.tar.gz
| Download URL | datasette_debug_bar-0.0.1a1.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5390f656852cf3e3404d625757fc6f27c69be86f3784c7901b87562740085689
|
|
BLAKE2b-256 checksum How to use checksums |
12fcd72442c1ca1b553f9a24426edf3d0d61eb1048e8b40961d22c9cad79e506
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logRelease files / datasette_debug_bar-0.0.1a1-py3-none-any.whl
| Download URL | datasette_debug_bar-0.0.1a1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee4e70a2beeb1fe65784c81edb81595b5a37075443108041cf7c7da0bf5016f3
|
|
BLAKE2b-256 checksum How to use checksums |
e3d8521a72d1611391b9b771dd271c2c806900436e50b2c78ca80748cab66ba4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency log