Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Commons IP schema validation #60

Merged
merged 10 commits into from
Aug 29, 2024
4 changes: 2 additions & 2 deletions eark_validator/infopacks/information_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def details_from_mets_file(mets_file: Path) -> PackageDetails:
except (etree.XMLSyntaxError, AttributeError) as ex:
raise ValueError(NOT_VALID_FILE.format(mets_file, 'XML')) from ex
return PackageDetails.model_validate({
'name': mets_file.parent.stem,
'label': label,
'othertype': othertype,
CONTENTINFORMATIONTYPE: contentinformationtype,
Expand All @@ -87,9 +88,8 @@ def from_path(package_path: Path) -> InformationPackage:
raise ValueError('No METS file found in package')
mets: MetsFile = MetsFiles.from_file(to_parse.joinpath(METS_FILE))
return InformationPackage.model_validate({
'name': to_parse.stem,
METS: mets,
'package': InformationPackages.details_from_mets_file(to_parse.joinpath(METS_FILE))
'details': InformationPackages.details_from_mets_file(to_parse.joinpath(METS_FILE))
})

@staticmethod
Expand Down
Loading
Loading