fast_dashboards
HTML dashboards for FastMVC: FastAPI routers and shared layout/CSS for operational UIs—health, API activity, queues, tenants, secrets, workflows—and a reusable render_dashboard_page layout helper. Also signed embed URLs (time-limited HMAC) and Metabase / Grafana embed helpers behind one protocol.
Python: 3.10+ · Dependencies: fastapi, httpx, loguru, pydantic>=2, sqlalchemy>=2 · Optional: PyJWT for Metabase (pip install 'fast_dashboards[metabase]').
What you get
sign_embed_url,verify_signed_embed_url— appendexp+sig(HMAC-SHA256) for iframe-safe dashboard URLs; optional signedtid(revocation id),theme,localequery params.EmbedRevocationChecker,InMemoryEmbedRevocationList— block leaked embeds by revokingtidbefore expiry.EmbedThemeParams,theme_to_extra_params— bundle dark/light + locale forsign_embed_url/ Grafana.DashboardEmbedProvider,MetabaseEmbedProvider,GrafanaEmbedProvider— unifiedbuild_embed_url(resource_id=..., ttl_seconds=...); Grafana supportstheme/locale/token_id; Metabase supportstheme(URL fragment) andlocale(JWT params).LookerEmbedProvider,PowerBIEmbedProvider— stubs; use Looker Signed Embed / Power BI GenerateToken (see below).- Composite
DashboardRouter— nested routers (health, API, queues, tenants, secrets, workflows); lazy-imported from the package root sofast_dashboards.layoutworks without the full host app onPYTHONPATH. layout.render_dashboard_page,BASE_CSS— shared HTML shell for dashboards with production SEO (Open Graph, Twitter Card, canonical URL whenFASTMVC_PUBLIC_BASE_URLis set, JSON-LDWebPage+SoftwareApplication,theme-color, safenoindex, nofollowdefaults for internal ops UIs).core.seo—PageSEO,render_seo_head,render_dashboard_inline_head, androbots_txt_*helpers for public sites vs private dashboards.- Per-area routers — e.g.
HealthDashboardRouter,ApiDashboardRouter, … (seesrc/fast_dashboards/).
Note: Many sub-routers expect host app modules (
core.datastores,start_utils, configurations, …). Run inside a full FastMVC app or only import submodules you need (e.g.layout,embed_signing,providers).
Core vs dashboards: Generic “platform” building blocks that used to live under
fast_dashboards.core(auth, tracing, encryption, smart cache, saga, etc.) are implemented infast-platformunderfast_platform.core(andfast_platform.caching).fast_dashboards.corestill re-exports them for compatibility; preferfrom fast_platform.core…in new code. Dashboard-only pieces remain here (layout,router, embed signing/theme/SEO, …).
Looker (recipe)
Looker Signed embed uses a server-generated SSO URL per session. Implement a small service that calls Looker’s API with your embed secret, then pass the returned URL to the iframe. Do not expect a static build_embed_url from this package — LookerEmbedProvider is a deliberate stub.
Power BI (recipe)
Use the Power BI REST API GenerateToken for reports/dashboards (Azure AD app registration). Return the embed URL + token to the client per Microsoft’s embed flow. PowerBIEmbedProvider is a stub pointing you to that flow.
Revocation example
from fast_dashboards import InMemoryEmbedRevocationList, sign_embed_url, verify_signed_embed_url
secret = b"your-32-byte-secret-here!!!!"
block = InMemoryEmbedRevocationList()
url = sign_embed_url("https://dash.example.com/view", secret, 3600, token_id="session-abc")
# Later: leak detected
block.revoke("session-abc")
assert verify_signed_embed_url(url, secret, revocation=block) is None
Install
pip install -e ./fast_dashboards
Optional dev extras
pip install -e ".[dev]"
Related packages
fast_db— when dashboards query SQLAlchemy.- Monorepo: ../README.md.
Tooling
See CONTRIBUTING.md, Makefile, and PUBLISHING.md.
Documentation
| Document | Purpose |
|---|---|
| CONTRIBUTING.md | Dev setup, tests, monorepo sync |
| PUBLISHING.md | PyPI and releases |
| SECURITY.md | Reporting vulnerabilities |
| CHANGELOG.md | Version history |
Monorepo: ../README.md · Coverage: ../docs/COVERAGE.md
Metadata
Release files for fast-dashboards 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fast_dashboards-1.6.0.tar.gz | 84.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fast_dashboards-1.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 160.9 kB
Release files / fast_dashboards-1.6.0.tar.gz
| Download URL | fast_dashboards-1.6.0.tar.gz |
|---|---|
| Size | 84.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c7bf011ad6ff79a5352105134bde6a83099b54b5f7082b7520065e49c9f2898
|
|
BLAKE2b-256 checksum How to use checksums |
f1089dae736b42feb2ed9eee07c3c62f2b2756ab97e90d889858c2afb8003de5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / fast_dashboards-1.6.0-py3-none-any.whl
| Download URL | fast_dashboards-1.6.0-py3-none-any.whl |
|---|---|
| Size | 76.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
871bf4f0f31dbbf1071e07ee34a3a4fbf31f8a99c66dc9cf3828aa90ffab422e
|
|
BLAKE2b-256 checksum How to use checksums |
bbeb1e7da847a9363ccd8cafae45e4b5d65351fe6955e8e76ed175b3ef9fb2de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|