Class XmlStreamExtractor

Stream XML tags extractor.

Do not need to parse all a XML document if you only need tags from beginning of it.

class http_stream_xml.xml_stream.XmlStreamExtractor(tags_to_collect: Sequence[str])

Extract given tags from XML streamed to it by chunks (in method feed).

When all tags are found, extraction_completed is True. Found tags would be available in dict tags.

feed(chunk: str) None

Feed next part of XML into the parser.

Parameters:

chunk – XML document part

Returns:

None

property tags: Dict[str, str]

Return found tags.