Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

No project description provided

Project description

build status coverage status

An asyncio library for graphite.

You can find out more here:

What is aiographite ?

aiographite is Python3 library ultilizing asyncio, designed to help Graphite users to send data into graphite easily.

Installing it globally

You can install aiographite globally with any Python package manager:

pip install aiographite

Quick start

Let’s get started.

from aiographite import connect
from aiographite.protocol import PlaintextProtocol

  Initialize a aiographite instance
loop = asyncio.get_event_loop()
plaintext_protocol = PlaintextProtocol()
graphite_conn = await connect(*httpd.address, plaintext_protocol, loop=loop)

  Send a tuple (metric, value , timestamp)
await graphite_conn.send(metric, value, timestamp)

  Send a list of tuples List[(metric, value , timestamp)]
await graphite_conn.send_multiple(list)

  aiographite library also provides GraphiteEncoder module,
  which helps users to send valid metric name to graphite.
  For Example: (metric_parts, value ,timestamp)
metric = graphite_conn.clean_and_join_metric_parts(metric_parts)
await graphite_conn.send(metric, value, timestamp)

  Close connection
await graphite_conn.close()


A simple example.

from aiographite.protocol import PlaintextProtocol
from aiographite import connect
import time
import asyncio

LOOP = asyncio.get_event_loop()
PORT = 2003

async def test_send_data():
  # Initiazlize an aiographite instance
  plaintext_protocol = PlaintextProtocol()
  graphite_conn = await connect(SERVER, PORT, plaintext_protocol, loop=LOOP)

  # Send data
  timestamp = time.time()
  for i in range(10):
    await graphite_conn.send("yun_test.aiographite", i, timestamp + 60 * i)))

def main():

if __name__ == '__main__':


Run unit tests.

./uranium test

Graphite setup

Do not have graphite instances ? Set up a graphite instance on your local machine!

Please refer:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiographite, version 0.1.9
Filename, size File type Python version Upload date Hashes
Filename, size aiographite-0.1.9-py2.py3-none-any.whl (11.8 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size aiographite-0.1.9.tar.gz (8.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page