Parser¶
-
exception
bertlv.parser.
ParserError
(message: str, *, tag: Optional[bertlv.tag.Tag] = None, offset: Optional[int] = None, element: Optional[xml.etree.ElementTree.Element] = None)[source]¶ Bases:
bertlv.tree.TlvError
-
exception
bertlv.parser.
InsufficientDataError
(message: str, **kwargs)[source]¶ Bases:
bertlv.parser.ParserError
-
class
bertlv.parser.
ParserBase
(*, target: Optional[bertlv.tree.BuilderBase] = None)[source]¶ Bases:
abc.ABC
-
abstract
close
() → bertlv.tree.Tree[source]¶ Close the parser and return the tree.
-
abstract
-
class
bertlv.parser.
BinaryParser
(*, target: Optional[bertlv.tree.BuilderBase] = None)[source]¶ Bases:
bertlv.parser.ParserBase
-
close
() → bertlv.tree.Tree[source]¶ Close the parser and return the tree.
-
-
class
bertlv.parser.
XmlParser
(*, target: Optional[bertlv.tree.BuilderBase] = None)[source]¶ Bases:
bertlv.parser.ParserBase
-
close
() → bertlv.tree.Tree[source]¶ Close the parser and return the tree.
-
-
bertlv.parser.
parse
(fp: BinaryIO, parser: bertlv.parser.ParserBase) → bertlv.tree.Tree[source]¶ Parse data read from the file-like object fp and return the tree.
-
bertlv.parser.
parse_bytes
(data: bytes, parser: bertlv.parser.ParserBase) → bertlv.tree.Tree[source]¶ Parse data and return the tree.