aiocarbon 0.17.0


pip install aiocarbon

  Latest version

Released: Oct 24, 2026


Meta
Author: Dmitry Orlov
Requires Python: >=3.11

Classifiers

Development Status
  • 5 - Production/Stable

Framework
  • AsyncIO

Intended Audience
  • Developers
  • System Administrators

Natural Language
  • English

Operating System
  • MacOS
  • POSIX
  • POSIX :: Linux

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: 3.15
  • Python :: Free Threading :: 3 - Stable
  • Python :: Implementation :: CPython

Topic
  • Software Development :: Libraries :: Python Modules
  • System :: Monitoring

Typing
  • Typed
Tests Coveralls Latest Version https://img.shields.io/pypi/wheel/aiocarbon.svg https://img.shields.io/pypi/pyversions/aiocarbon.svg https://img.shields.io/pypi/l/aiocarbon.svg

Client for feeding data to graphite. The package requires Python 3.11 or newer, and has no runtime dependencies.

Installation

pip install aiocarbon

Example

Counter example:

import asyncio

import aiocarbon


async def main():
    client = aiocarbon.setup(
        host="127.0.0.1", port=2003, client_class=aiocarbon.TCPClient
    )

    # Send the collected metrics every second.
    sender = asyncio.create_task(client.run())

    for _ in range(1000):
        with aiocarbon.Counter("foo"):
            await asyncio.sleep(0.1)

    # Send the rest of the metrics before the exit.
    await client.send()

    sender.cancel()


if __name__ == "__main__":
    asyncio.run(main())

Clients

  • aiocarbon.TCPClient sends metrics in the plaintext protocol over TCP.

  • aiocarbon.UDPClient sends metrics in the plaintext protocol over UDP.

  • aiocarbon.PickleClient sends metrics in the pickle protocol, port 2004.

Each client aggregates the metrics in a storage. TotalStorage is the default one, and it adds up the values of one metric in one second. RawStorage keeps every sample.

Development

The project uses uv for the environment, and ruff, mypy and pytest for the checks:

uv sync
uv run ruff check .
uv run mypy
uv run pytest

Wheel compatibility matrix

Platform Python 3
any

Files in release

No dependencies