--- id: grafanalib version: "0.7.1" license: Apache license_treatment: permissive maintenance: aging --- # grafanalib — Library for building Grafana dashboards License: permissive · Maintenance: aging · Downloads: 393.3K/mo ## What it is and what it does grafanalib is a Python library that generates Grafana dashboard JSON from code, letting you define monitoring dashboards as Python objects instead of through Grafana's UI. It depends only on attrs and installs as a pure Python wheel with low friction. The library is designed for teams that want to version-control dashboards, reuse common patterns across multiple dashboards, and automate dashboard creation as part of infrastructure-as-code workflows. The package is in alpha status and has been maintained since 2016, though recent activity has slowed—the last release was over a year ago and the maintainers acknowledge reduced availability. It supports Python 3.7 through 3.11 and works by letting you write Python scripts that describe dashboard structure, then using the generate-dashboard command to output JSON ready for Grafana provisioning. Use it for: - Version-control Grafana dashboards in Git alongside infrastructure code and application monitoring definitions - Build reusable dashboard templates and patterns to standardize monitoring across multiple services or teams - Automate dashboard creation in CI/CD pipelines when spinning up new environments or services - Reduce repetition by factoring out common graph, alert, and panel configurations into Python functions - Generate dashboards programmatically from metrics metadata or service inventory ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates Grafana dashboards from Python code, letting you version-control, template, and programmatically build monitoring configurations instead of editing them through the UI. Yes, if you need to version-control and template Grafana dashboards. The low install friction, permissive license, and established community make it a solid choice for infrastructure-as-code workflows. However, be aware that maintenance is aging—last release was over a year ago and maintainers have reduced availability. Check that the library supports your Grafana version and required dashboard features before committing to it in a production pipeline. ## Install pip install grafanalib uv add grafanalib poetry add grafanalib ## Installing grafanalib Before you install: Low install friction with a single runtime dependency (attrs). Maintenance status is aging—last release was over a year ago and maintainers note reduced availability, though the repository remains active and the project has moderate community adoption. License in practice: Apache License (permissive) places no restrictions on use, modification, or distribution for commercial or private projects. Quickstart: pip install grafanalib from grafanalib.core import Dashboard, Row, Graph dash = Dashboard(title="My Dashboard", rows=[Row(panels=[...])]) generate-dashboard -o dashboard.json example.dashboard.py Verify before relying: - Whether the library supports all current Grafana dashboard features and API versions - Maintenance timeline and whether critical bugs or Grafana compatibility issues are addressed promptly - Python 3.12+ support status (classifiers list up to 3.11) ## Package facts - License: Apache (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 393.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags grafana dashboard as code, python grafana automation, version control dashboards, grafana json generation, infrastructure monitoring templates, dashboard configuration python, grafana provisioning library, infrastructure-as-code, grafana-automation, dashboard-templating [View on SkillFed](https://skillfed.io/packages/grafanalib) · [View on PyPI](https://pypi.org/project/grafanalib/)