Registry / observability / grafana-foundation-sdk

grafana-foundation-sdk

JSON →
library1769699998!10.1.0pypypi✓ verified 83d ago

A set of tools, types and libraries for building and manipulating Grafana objects (e.g., dashboards, alerts) in Python. Current version: 10.1.0 (pre-release versioning). Released irregularly alongside Grafana versions.

pip install grafana-foundation-sdk
INSTALL
IMPORT
SIG · GRAFANA-FOUNDATION
G
grafana-foundation-sdk
observabilitypythonv1769699998!10.1.0
Install
1.8s avg
Import
63ms
Disk
19MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1769699998!10.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✕ build_error
py 3.11
✓ —
✓ 1.9s
py 3.12
✓ —
✓ 1.8s
py 3.13
✓ —
✓ 1.8s
py 3.9
✕ build_error
✕ build_error
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Dashboard
from grafana_foundation_sdk.models.dashboard import Dashboard
from grafana_foundation_sdk import Dashboard
Top-level exports do not include models; must import from the specific submodule.
GrafanaDashboard
from grafana_foundation_sdk.builders.dashboard import DashboardBuilder
from grafana_foundation_sdk import GrafanaDashboard
The library uses builders, not a single class. Common mistake to look for a 'GrafanaDashboard' class.

Build a minimal dashboard with one panel and export as JSON.

from grafana_foundation_sdk.builders.dashboard import DashboardBuilder from grafana_foundation_sdk.models.dashboard import Dashboard builder = DashboardBuilder( title="My Dashboard", tags=["generated"] ) panel = builder.add_panel( title="CPU Usage", type="timeseries", datasource={"type": "prometheus", "uid": "prometheus_default"} ) dashboard: Dashboard = builder.build() print(dashboard.model_dump_json(indent=2))
Debug
Known issues
breakingThe SDK versioning uses a epoch-like timestamp prefix (e.g., 1769699998!10.1.0). This is non-standard and may break tools that parse version numbers like PEP 440. Pin to exact version.
fix
Use `pip install grafana-foundation-sdk==1769699998!10.1.0` to pin.
affects: All versions (e.g., 1769699998!10.1.0)
gotchaModels are not re-exported at the top-level `grafana_foundation_sdk` package. Attempting `from grafana_foundation_sdk import Dashboard` will fail with ImportError.
fix
Import from the correct submodule: `from grafana_foundation_sdk.models.dashboard import Dashboard`.
affects: All
deprecatedThe `grafana-foundation-sdk` package pre-10.0 used different model paths and builders. Version 10.0+ introduced a new model hierarchy and deprecated old imports like `grafana_foundation_sdk.schema`.
fix
Migrate imports to `grafana_foundation_sdk.models.*` and `grafana_foundation_sdk.builders.*`.
affects: <10.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'grafana_foundation_sdk'
Package not installed in current environment.
fix
Run `pip install grafana-foundation-sdk` (note the hyphens in the package name).
ImportError: cannot import name 'Dashboard' from 'grafana_foundation_sdk'
Trying to import model from package root, but models are in submodules.
fix
Use `from grafana_foundation_sdk.models.dashboard import Dashboard`.
TypeError: Panel() takes no arguments
Trying to create a panel by directly instantiating `Panel()` model class instead of using builder.
fix
Use `DashboardBuilder().add_panel(...)` or the appropriate builder class.
Upgrade
Version history
1769699998!10.1.0latest on PyPI · released Jan 29, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
grafana-foundation-sdk — pip install grafana-foundation-sdk · libregistry