Grafana API client on pure Python.

  • Official Grafana API reference: API

Implemented functional:

  • Folder operations.
  • Dashboard operations.
  • Datasource operations.

Configure environment:

python3 -m venv --upgrade-deps env && \
./env/bin/pip3 install -r requirements_dev.txt

Scan project dependencies:

./env/bin/pip-audit -f json | python3 -m json.tool

Validate project files:

./env/bin/flake8 --ignore="E501" *.py

Run unit tests:

export GRAFANA_TOKEN=''
./env/bin/python3 grafana_test.py -v

How to use Grafana client:

import grafana

client = grafana.Grafana(grafana_url, grafana_sa_token)

Tutorials for other tools: