skillfed

grafana-foundation-sdk

A set of tools, types and libraries for building and manipulating Grafana objects.

grafana-foundation-sdk v1769699998!10.1.0 356.0K downloads/30d#7,285 on PyPI252
Permissive license Active released

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-sdk

uv

uv add grafana-foundation-sdk

poetry

poetry add grafana-foundation-sdk

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Software Development :: LibrariesTopic :: System :: Monitoring

Tags

grafana dashboard builder pythongrafana sdk pythonprogrammatic grafana dashboardgrafana object typesgrafana panel buildergrafana query builderinfrastructure as code grafana
infrastructure-as-codegrafanabuilder-pattern

More Libraries packages