skillfed

grafana-client

A client library for accessing the Grafana HTTP API, written in Python

grafana-client v5.1.0 191.1K downloads/30d#9,894 on PyPI141
Permissive license MIT Active released

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

uv

uv add grafana-client

poetry

poetry add grafana-client

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Information TechnologyIntended Audience :: ManufacturingIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsIntended Audience :: Telecommunications IndustryLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: OS IndependentOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: CommunicationsTopic :: DatabaseTopic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Human Machine InterfacesTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: Interface Engine/Protocol TranslatorTopic :: Scientific/Engineering :: VisualizationTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: ArchivingTopic :: System :: Networking :: MonitoringTopic :: Utilities

Tags

grafana api clientgrafana dashboard automationgrafana http clientgrafana user managementgrafana python sdkgrafana rest api wrappergrafana async client
grafana-automationasync-supportinfrastructure-as-code

More Software Development packages