Registry / serialization / line-protocol-parser

line-protocol-parser

JSON →
library2.0.0pypypi✓ verified 84d ago

A fast C-based parser for InfluxDB line protocol, converting strings into Python dictionaries. Current version 2.0.0 (2025), requires Python >=3.10. Active development with regular releases.

pip install line-protocol-parser
INSTALL
IMPORT
SIG · LINE-PROTOCOL-PARS
L
line-protocol-parser
serializationpythonv2.0.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse_line
from line_protocol_parser import parse_line
parse_lines
from line_protocol_parser import parse_lines

Parse a single line protocol string.

from line_protocol_parser import parse_line line = 'weather,location=us-midwest temperature=82 1465839830100400200' result = parse_line(line) print(result) # {'measurement': 'weather', 'tags': {'location': 'us-midwest'}, 'fields': {'temperature': 82}, 'timestamp': 1465839830100400200, 'has_time': True}
Debug
Known issues
breakingIn version 2.0.0, omitted timestamps now yield None for timestamp and has_time=False, instead of timestamp=0. Check code that assumed explicit 0 for missing timestamps.
fix
Update logic that compares timestamp to 0; use has_time field to distinguish.
affects: >=2.0.0
breakingDuplicate tags within a single line are now rejected as malformed. Previously, the last tag might silently override earlier ones.
fix
Ensure no duplicate tag keys in input lines.
affects: >=2.0.0
gotchaParser is strict about key/value formatting: tag keys and field keys must not start with underscore, must be valid identifiers, etc. Invalid lines raise ValueError.
fix
Sanitize line protocol strings before parsing.
affects: >=2.0.0
Errors
Common errors & fixes
ValueError: Invalid line protocol: duplicate tag key 'location'
The input line contains the same tag key more than once.
fix
Remove duplicate tag keys from the line.
ValueError: Invalid line protocol: unexpected trailing characters
Extra whitespace or characters after the timestamp or at end of line.
fix
Trim trailing whitespace or ensure line ends after valid timestamp.
ValueError: Invalid line protocol: missing measurement name
Line is empty or starts with a comma or space.
fix
Ensure line starts with a valid measurement name.
AttributeError: module 'line_protocol_parser' has no attribute 'parse_line'
Trying to import from a wrong package name (e.g., 'line_protocol_parser' vs 'line-protocol-parser').
fix
Install correct package: pip install line-protocol-parser
Upgrade
Version history
2.0.0latest on PyPI · released Mar 25, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
line-protocol-parser — pip install line-protocol-parser · libregistry