Skip to content

maxyz/pyilpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InfluxDB line protocol parser

A simple InfluxDB line protocol parser built using pyparsing.

The entry point is the parse function which receives a string and returns a list of the parsed line-protocol.

Example

>>> import pyilpp
>>> data = """
... measurement,tag1=tag_value1,tag2=tag_value2 int=1i,uint=1u,float=0.0,str="foo bar",boolean=t 1556813561098000000
... measurement2,tag1=tag_value1,tag2=tag_value2 int=1i,uint=1u,float=0.0,str="foo bar",boolean=t 1556813561098000000
... """
>>> res = pyilpp.parse(data)
>>> print(res)
[{'measurement': 'measurement',
  'tags': {'tag1': 'tag_value1', 'tag2': 'tag_value2'},
  'fields': {'int': 1,
             'uint': 1,
             'float': 0.0,
             'str': 'foo bar',
             'boolean': True},
  'time': 1556813561098000000},
 {'measurement': 'measurement2',
  'tags': {'tag1': 'tag_value1', 'tag2': 'tag_value2'},
  'fields': {'int': 1,
             'uint': 1,
             'float': 0.0,
             'str': 'foo bar',
             'boolean': True},
  'time': 1556813561098000000}]

Installation

From PyPI:

$ python3 -m pip install pyilpp

or from source (needs pdm):

$ git clone https://github.com/maxyz/pyilpp.git
$ cd pyilpp
$ pdm build
$ python3 -m pip install ./dist/pyilpp-*.whl

About

idb line protocol parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages