Skip to main content

Influx Object Package

Project description

Influx Point

Description

This module enables the creation of an influx point object that can be transformed into either a JSON or LineProtocol format.

Uage

 influx_point = InfluxPoint()
        influx_point.set_measurement("measurement")
        influx_point.set_tags({"tag1": "value1"})
        influx_point.set_fields({"field1": 1, "field2": 2})
        influx_point.set_timestamp(datetime.datetime(2021, 1, 1))\
        
        print(influx_point.to_json())

            # {
            #     "measurement": "measurement",
            #     "tags": {"tag1": "value1"},
            #     "fields": {"field1": 1, "field2": 2},
            #     "timestamp": 1609455600,
            # }
        
        print(influx_point.to_line_protocol())

            # "measurement,tag1=value1 field1=1,field2=2 1609455600"

Installation

To install the package use the pip package manager

    pip install influxobject==0.0.1

Development

Tox is used as the test runner for this project. To run the tests use the following command

    tox

```bash
    tox -e py39

Build

python setup.py sdist

Publish

    twine upload dist/*

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

influxobject-0.0.2.tar.gz (5.8 kB view hashes)

Uploaded Source

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