Closed digitaldogsbody closed 1 year ago
The add_image helper allows passing in ID fields for the intermediate AnnotationPage and Annotation objects.
add_image
AnnotationPage
Annotation
This is quite a nice pattern and allows avoiding the following:
canvas = manifest.create_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen", id="https://iiif.io/api/cookbook/recipe/0005-image-service/canvas/p1", label="Canvas with a single IIIF image") manifest.add_item(canvas) canvas.items[0].id = "https://iiif.io/api/cookbook/recipe/0005-image-service/page/p1/1" canvas.items[0].items[0].id = "https://iiif.io/api/cookbook/recipe/0005-image-service/annotation/p0001-image"
We should consider extending this pattern into other helpers that add intermediate objects (such as the create_canvas_from_iiif helper above)
create_canvas_from_iiif
Other instance is annotation_helpers.py (which also should probably take **kwargs)
annotation_helpers.py
**kwargs
The
add_image
helper allows passing in ID fields for the intermediateAnnotationPage
andAnnotation
objects.This is quite a nice pattern and allows avoiding the following:
We should consider extending this pattern into other helpers that add intermediate objects (such as the
create_canvas_from_iiif
helper above)