Skip to content

Commit

Permalink
Merge pull request #60 from E-ARK-Software/fix/commons-ip
Browse files Browse the repository at this point in the history
FEAT: Commons IP schema validation
  • Loading branch information
carlwilson authored Aug 29, 2024
2 parents c7b6eb4 + 1c65fe9 commit d1cea32
Show file tree
Hide file tree
Showing 14 changed files with 515 additions and 295 deletions.
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

0 comments on commit d1cea32

Please sign in to comment.