Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Implementation of influxdata line protocol format in python

Project description

Build Status PyPI version License

influx-line-protocol

Implementation of influxdata line protocol format in python

Installation

$ pip install influx_line_protocol

Usage

from influx_line_protocol import Metric

metric = Metric("weather")
metric.with_timestamp(1465839830100400200)
metric.add_tag('location', 'Cracow')
metric.add_value('temperature', '29')

print(metric)
"""
  Will print:
  weather,location=Cracow temperature=29 1465839830100400200
"""

Multiple metrics example

from influx_line_protocol import Metric, MetricCollection

collection = MetricCollection()
metric = Metric("weather")
metric.with_timestamp(1465839830100400200)
metric.add_tag('location', 'Cracow')
metric.add_value('temperature', '29')
collection.append(metric)

metric = Metric("weather")
metric.with_timestamp(1465839830100400200)
metric.add_tag('location', 'Nowy Sacz')
metric.add_value('temperature', '31')
collection.append(metric)

print(collection)
"""
  Will print
  weather,location="Cracow" temperature=29 1465839830100400200
  weather,location="Nowy Sacz" temperature=29 1465839830100400200
"""

License

See LICENSE file.

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 influx-line-protocol, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size influx-line-protocol-0.1.3.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page