def __init__(self, archive_record): path = archive_record.root with (path / self.METADATA_FILE).open() as fh: uuid, type, format = \ self._parse_metadata(fh, expected_uuid=archive_record.uuid) self.uuid = _uuid.UUID(uuid) self.type = sdk.parse_type(type) self.format = sdk.parse_format(format) self.path = path self.data_dir = path / self.DATA_DIR