Skip to main content

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.

Source Distribution

influx-line-protocol-0.1.5.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

influx_line_protocol-0.1.5-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file influx-line-protocol-0.1.5.tar.gz.

File metadata

  • Download URL: influx-line-protocol-0.1.5.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for influx-line-protocol-0.1.5.tar.gz
Algorithm Hash digest
SHA256 73954c9a0e09915b4a7e813cda425aec15f5deaf9d1d0e24a466f7067d207980
MD5 e2ce6a8c1f7af4cd5efbc1c4969fa55b
BLAKE2b-256 b0489b09f380856c48543502f35af33edfc474412cd686c659c1f0450fcb449d

See more details on using hashes here.

File details

Details for the file influx_line_protocol-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for influx_line_protocol-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 69d7dcd26e70088d6330700d910d8eb303fa36351c5bfa35519fe99238831880
MD5 f2abb1b5ee948a862f54179a30b48d46
BLAKE2b-256 661fe1e356c62487b0ca0641ae970c2928b06905133d9873571f84e230cf382d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page