ocrd.workspace_bagger module

class ocrd.workspace_bagger.WorkspaceBagger(resolver, strict=False)[source]

Bases: object

Serialize/De-serialize from OCRD-ZIP to workspace and back.

bag(workspace, ocrd_identifier, dest=None, ocrd_mets='mets.xml', ocrd_manifestation_depth='full', ocrd_base_version_checksum=None, processes=1, skip_zip=False, in_place=False, tag_files=None)[source]

Bag a workspace

See https://ocr-d.github.com/ocrd_zip#packing-a-workspace-as-ocrd-zip

Parameters:
  • workspace (ocrd.Workspace) – workspace to bag
  • ord_identifier (string) – Ocrd-Identifier in bag-info.txt
  • dest (string) – Path of the generated OCRD-ZIP.
  • ord_mets (string) – Ocrd-Mets in bag-info.txt
  • ord_manifestation_depth (string) – Ocrd-Manifestation-Depth in bag-info.txt
  • ord_base_version_checksum (string) – Ocrd-Base-Version-Checksum in bag-info.txt
  • processes (integer) – Number of parallel processes checksumming
  • skip_zip (boolean) – Whether to leave directory unzipped
  • in_place (boolean) – Whether to replace the workspace with its BagIt variant
  • tag_files (list<string>) – Path names of additional tag files to be bagged at the root of the bag
spill(src, dest)[source]

Spill a workspace, i.e. unpack it and turn it into a workspace.

See https://ocr-d.github.com/ocrd_zip#unpacking-ocrd-zip-to-a-workspace

Parameters:
  • src (string) – Path to OCRD-ZIP
  • dest (string) – Path to directory to unpack data folder to
validate(bag)[source]

Validate conformance with BagIt and OCR-D bagit profile.

See: