sertit.files.read_archived_xml¶
- read_archived_xml(archive_path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], xml_regex: str) lxml.etree._Element [source]¶
Read archived XML from zip or tar archives.
You can use this [site](https://regexr.com/) to build your regex.
>>> arch_path = 'D:\path\to\zip.zip' >>> file_regex = '.*dir.*file_name' # Use .* for any character >>> read_archived_xml(arch_path, file_regex) <Element LANDSAT_METADATA_FILE at 0x1c90007f8c8>