grafana-foundation-sdk
A set of tools, types and libraries for building and manipulating Grafana objects.
What it is and what it does
The Grafana Foundation SDK is a Python library that provides generated types and builder classes for constructing Grafana objects—dashboards, panels, queries, and their configurations—in code rather than through the UI. It ships with support for all core Grafana datasources (Prometheus, Loki, etc.) and panel types, and can be extended with custom query and panel types for third-party plugins.
The library is organized around a builder pattern: you chain method calls to configure objects, then call `.build()` to produce a JSON-serializable representation. It also supports unmarshaling: reading existing Grafana JSON and converting it back into typed Python objects. The types are generated from Grafana v10.1.x schemas, so the SDK is version-specific; other Grafana versions have separate branches in the repository.
Use it for:
- Generate Grafana dashboards programmatically from infrastructure definitions or monitoring requirements.
- Build dashboard templates that can be instantiated with different parameters for different environments.
- Parse and modify existing Grafana dashboards exported as JSON without manual editing.
- Integrate Grafana dashboard creation into CI/CD pipelines or infrastructure-as-code workflows.
- Define custom query types or panel options for private Grafana plugins.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python types, builders, and tools for programmatically constructing and manipulating Grafana dashboards, panels, queries, and related objects.
Yes. The package is actively maintained, has no security vulnerabilities, installs with zero dependencies, and is permissively licensed. It is well-suited for anyone building Grafana dashboards programmatically or managing them as code. The main consideration is that it targets Grafana v10.1.x specifically; if you use a different Grafana version, you will need the corresponding SDK branch.
Install
grafana-foundation-sdk on PyPI
pip
pip install grafana-foundation-sdkuv
uv add grafana-foundation-sdkpoetry
poetry add grafana-foundation-sdkInstalling grafana-foundation-sdk
Before you install
Low install friction; pure Python wheel with no runtime dependencies. Actively maintained with recent commits and a stable release cadence.
License in practice
Permissive license (Apache Software License) allows commercial and private use with minimal restrictions.
Quickstart
pip install 'grafana_foundation_sdk==1769699998!10.1.0'
from grafana_foundation_sdk.builders.dashboard import Dashboard
from grafana_foundation_sdk.builders.timeseries import Panel as Timeseries
from grafana_foundation_sdk.cog.encoder import JSONEncoder
dashboard = Dashboard("My Dashboard").with_panel(
Timeseries().title("Metric")
).build()
print(JSONEncoder().encode(dashboard))
Requires Python 3.11 or later.
Verify before relying
- Whether the generated types cover all Grafana v10.1.x panel and datasource types, or if custom extensions are often needed.
- Performance characteristics when building or unmarshaling large dashboards with many panels and queries.
- Compatibility guarantees when upgrading between Grafana versions or SDK releases.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 197 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 356,035/month — #7,285 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: grafana_foundation_sdk-1769699998!10.1.0-py3-none-any.whl
Keywords: grafana, logs, metrics, observability, sdk, traces
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
grafanalibGenerates Grafana dashboards from Python code,…
permissive · top 15,000 on PyPI
grafana-clientA Python client library for the Grafana HTTP…
permissive · top 15,000 on PyPI
mcp-grafanaAn MCP server that exposes Grafana dashboards,…
permissive · top 15,000 on PyPI
pulumiverse-grafanaA Pulumi resource provider that lets you create…
permissive · top 15,000 on PyPI
mypy-boto3-grafanaProvides type annotations and IDE…
permissive · top 15,000 on PyPI
panelPanel is a Python framework for building…
permissive · top 5,000 on PyPI
panel-material-uiPanel Material UI brings Material Design…
permissive · top 5,000 on PyPI
grafana-django-saml2-authA compatibility shim that redirects to…
permissive · top 15,000 on PyPI
sphinx-panelsA Sphinx extension that adds directives for…
permissive · top 15,000 on PyPI
wandb-workspacesProgrammatically create and manage Weights &…
permissive · top 15,000 on PyPI