comect.sidecar.parsers package¶
-
class
comect.sidecar.parsers.
Parser
¶ Bases:
abc.ABC
Parsers are in charge of transforming lines of text into usable objects, where required.
They can simply transform the string and return it, or they can change it into some other object entirely. Like the Filters, you could just use a function if that suits you better.
If you’re subclassing, then you must implement
__call__()
.
-
class
comect.sidecar.parsers.
JSONParser
¶ Bases:
comect.sidecar.parsers.base.Parser
A parser that parses lines of JSON data, or throws a ValueError on invalid JSON.
-
class
comect.sidecar.parsers.
XMLParser
¶ Bases:
comect.sidecar.parsers.base.Parser
A parser that transforms parses XML data, or throws a ValueError on badly-formed XML.
As this uses the standard library, it returns a normal ElementTree.