{"id":23966,"library":"line-protocol-parser","title":"line-protocol-parser","description":"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.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/Penlect/line-protocol-parser","tags":["influxdb","line-protocol","parser","time-series"],"install":[{"cmd":"pip install line-protocol-parser","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"parse_line","correct":"from line_protocol_parser import parse_line"},{"note":"","wrong":null,"symbol":"parse_lines","correct":"from line_protocol_parser import parse_lines"}],"quickstart":{"code":"from line_protocol_parser import parse_line\n\nline = 'weather,location=us-midwest temperature=82 1465839830100400200'\nresult = parse_line(line)\nprint(result)\n# {'measurement': 'weather', 'tags': {'location': 'us-midwest'}, 'fields': {'temperature': 82}, 'timestamp': 1465839830100400200, 'has_time': True}","lang":"python","description":"Parse a single line protocol string."},"warnings":[{"fix":"Update logic that compares timestamp to 0; use has_time field to distinguish.","message":"In 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.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure no duplicate tag keys in input lines.","message":"Duplicate tags within a single line are now rejected as malformed. Previously, the last tag might silently override earlier ones.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Sanitize line protocol strings before parsing.","message":"Parser 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.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Remove duplicate tag keys from the line.","cause":"The input line contains the same tag key more than once.","error":"ValueError: Invalid line protocol: duplicate tag key 'location'"},{"fix":"Trim trailing whitespace or ensure line ends after valid timestamp.","cause":"Extra whitespace or characters after the timestamp or at end of line.","error":"ValueError: Invalid line protocol: unexpected trailing characters"},{"fix":"Ensure line starts with a valid measurement name.","cause":"Line is empty or starts with a comma or space.","error":"ValueError: Invalid line protocol: missing measurement name"},{"fix":"Install correct package: pip install line-protocol-parser","cause":"Trying to import from a wrong package name (e.g., 'line_protocol_parser' vs 'line-protocol-parser').","error":"AttributeError: module 'line_protocol_parser' has no attribute 'parse_line'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}