Skip to main content

Module parse

Module parse 

Source
Expand description

Object/property shorthand parsing for integrators.

Handles full names (kebab-case), common abbreviations, and numeric values for BACnet object types, property identifiers, and write values. A write value typed for a known property (parse_value_for) also takes its enumeration and bit names, and dates, times and timestamps in the forms the formatter prints, so what a read shows can be typed back.

Functions§

parse_date
A date with no time after it: 2026-10-19, 2026-10-19 Mon, *-*-* Fri, any date.
parse_date_time
A date and maybe a time after it, as the formatter writes them: 2026-10-19, 2026-10-19 Mon 07:00, any date 07:00, or unspecified for neither. The time is None when none was typed.
parse_object_specifier
Parse an object specifier like analog-input:1 or ai:1 into (ObjectType, instance).
parse_object_type
Parse an object type from a string.
parse_property
Parse a property identifier from a string.
parse_time
A time: HH:MM, HH:MM:SS or HH:MM:SS.hh, * for any field, or any time. Fields left off are 0.
parse_timestamp
A BACnetTimeStamp as the formatter prints one: seq 42, a time (14:30:05, any time), or a date and time (2026-10-25 Sun 14:30:05; a date alone leaves the time unspecified).
parse_value
Parse a write value from a string, with no property to say its datatype. parse_value_for reads names and named bits for a known property.
parse_value_for
Parse a value typed for property of an object of object_type, at index when the write names one, knowing the property’s datatype:
parse_value_for_with_priority
parse_value_for with an optional @priority suffix, as parse_value_with_priority splits it.
parse_value_with_priority
Parse a value with optional @priority suffix.