grafana-client
A client library for accessing the Grafana HTTP API, written in Python
What it is and what it does
grafana-client is a Python wrapper around the Grafana HTTP API that lets you automate Grafana administration and dashboard management from code. It provides both synchronous and asynchronous interfaces to create, update, and delete dashboards; manage users, teams, and organizations; configure data sources; and handle permissions and alerts. The library handles authentication via API tokens, HTTP Basic Auth, header-based auth, or anonymous access, and supports custom DNS resolution and HTTP proxies through its underlying niquests dependency.
The package covers most of the Grafana API surface—admin operations, dashboards, data sources, folders, teams, users, annotations, snapshots, and plugins are fully supported, while some subsystems like alerting and RBAC have partial support. It includes client-side data source health checks for Grafana 7+ and works with Python 3.7 through 3.14, making it suitable for monitoring automation, infrastructure-as-code workflows, and programmatic dashboard provisioning.
Use it for:
- Automate dashboard creation and updates as part of infrastructure-as-code or CI/CD pipelines.
- Programmatically manage Grafana users, teams, and organization membership in multi-tenant environments.
- Build monitoring automation scripts that create alerts, configure data sources, and set up dashboards without manual UI interaction.
- Integrate Grafana provisioning into deployment workflows to ensure consistent monitoring setups across environments.
- Perform bulk operations like exporting dashboards, managing permissions, or syncing external groups via the Admin API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client library for the Grafana HTTP API, supporting both synchronous and asynchronous operations to manage dashboards, users, teams, data sources, and other Grafana resources.
Yes. grafana-client is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It covers the majority of the Grafana API with both sync and async support, making it the standard choice for Grafana automation in Python. Install it if you need to programmatically manage Grafana resources.
Install
grafana-client on PyPI
pip
pip install grafana-clientuv
uv add grafana-clientpoetry
poetry add grafana-clientInstalling grafana-client
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and a stable release cycle. Depends on niquests, importlib-metadata, and verlib2—all lightweight runtime dependencies.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install grafana-client
from grafana_client import GrafanaApi
grafana = GrafanaApi.from_url("https://username:password@grafana.example.org/grafana/")
user = grafana.admin.create_user({"name": "User", "email": "user@example.org", "login": "user", "password": "pass", "OrgId": 1})
Verify before relying
- Whether all Grafana versions 5.x–13.x are equally well-supported or if certain API subsystems have version-specific limitations beyond the documented +/+- status indicators.
- Performance characteristics under high concurrency with the async API, particularly with custom session pool sizes.
- Whether the client-side data source health check implementation for Grafana <9 has feature parity with the server-side API in Grafana 9+.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — niquests, importlib-metadata, verlib2 |
| Maintenance | actively maintained — 114 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 191,058/month — #9,894 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: grafana_client-5.1.0-py3-none-any.whl
Keywords: grafana, http, api, grafana-client, grafana-api, http-client, grafana-utils, grafana-automation, grafana-toolbox
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
mcp-grafanaAn MCP server that exposes Grafana dashboards,…
permissive · top 15,000 on PyPI
grafanalibGenerates Grafana dashboards from Python code,…
permissive · top 15,000 on PyPI
grafana-foundation-sdkProvides Python types, builders, and tools for…
permissive · top 15,000 on PyPI
kanboardA Python client library that wraps the Kanboard…
permissive · top 15,000 on PyPI
pulumiverse-grafanaA Pulumi resource provider that lets you create…
permissive · top 15,000 on PyPI
aiven-clientOfficial command-line client for Aiven's…
permissive · top 15,000 on PyPI
merakiA Python client library for the Cisco Meraki…
permissive · top 5,000 on PyPI
msgraph-sdkPython client library for calling Microsoft…
permissive · top 5,000 on PyPI
grafana-django-saml2-authA compatibility shim that redirects to…
permissive · top 15,000 on PyPI
urllib3-futureHTTP client library supporting HTTP/1.1,…
permissive · top 5,000 on PyPI