Code reference
helpers
add_image
AddImage
Source code in iiif_prezi3/helpers/add_image.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
add_image(image_url, anno_id=None, anno_page_id=None, **kwargs)
Adds an image to an existing canvas.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_url |
str
|
An HTTP URL which points to the image. |
required |
anno_id |
str
|
An HTTP URL for the annotation to which the image will be attached. |
None
|
anno_page_id |
str
|
An HTTP URL for the annotation page to which the annotation will be attached. |
None
|
Returns:
Name | Type | Description |
---|---|---|
anno_page |
AnnotationPage
|
the AnnotationPage with an Annotation and ResourceItem attached. |
Source code in iiif_prezi3/helpers/add_image.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
add_item
AddItem
Source code in iiif_prezi3/helpers/add_item.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
add_item(item)
Add a IIIF Prezi3 object to the items list, creating it if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Union[Collection, Manifest, Canvas, AnnotationPage, Annotation, Range, Reference, SpecificResource, Item]
|
The object to be added |
required |
Source code in iiif_prezi3/helpers/add_item.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
AddItemByReference
Source code in iiif_prezi3/helpers/add_item.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
add_item_by_reference(item)
Add a IIIF Prezi3 object by reference to the items list, creating it if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Union[Manifest, AnnotationPage, Collection, AnnotationCollection, Canvas]
|
The object to be added |
required |
Source code in iiif_prezi3/helpers/add_item.py
25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
add_label
AddLabel
Source code in iiif_prezi3/helpers/add_label.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
add_label(value, language=None)
Adds a label to an existing resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Union[str, list]
|
The label or labels to be added |
required |
language |
str
|
An optional language for the labels. If not provided it will default using the AutoLang configuration. |
None
|
Source code in iiif_prezi3/helpers/add_label.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
add_service
AddService
Source code in iiif_prezi3/helpers/add_service.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
add_service(service)
Add a IIIF Prezi service to the service list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service |
(ServiceItem, ServiceItem1, Service)
|
A iiif-prezi ServiceItem. |
required |
Source code in iiif_prezi3/helpers/add_service.py
8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
add_thumbnail
AddThumbnail
Source code in iiif_prezi3/helpers/add_thumbnail.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
add_thumbnail(image_url, **kwargs)
Adds a thumbnail to an existing canvas.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_url |
str
|
An HTTP URL which points to the thumbnail. |
required |
**kwargs |
see ResourceItem. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
new_thumbnail |
ResourceItem
|
the newly-created thumbnail. |
Source code in iiif_prezi3/helpers/add_thumbnail.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
annotation_helpers
AnnotationHelpers
Source code in iiif_prezi3/helpers/annotation_helpers.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
add_annotation(annotation, anno_page_id=None)
Adds the annotation object to the (AnnotationPage object in the) annotations property.
Creates an AnnotationPage object if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annotation |
Annotation
|
the Annotation to add |
required |
anno_page_id |
str
|
An HTTP URL for the annotation page to which the annotation will be attached. |
None
|
Returns:
Name | Type | Description |
---|---|---|
annotation |
Annotation
|
the Annotation attached to the AnnotationPage. |
Source code in iiif_prezi3/helpers/annotation_helpers.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
make_annotation(anno_page_id=None, **kwargs)
Creates an annotation object and adds it to the annotations property using .add_annotation().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
anno_page_id |
str
|
An HTTP URL for the annotation page to which the annotation will be attached. |
None
|
**kwargs |
see Annotation. |
{}
|
Source code in iiif_prezi3/helpers/annotation_helpers.py
35 36 37 38 39 40 41 42 43 44 |
|
create_canvas_from_iiif
CreateCanvasFromIIIF
Source code in iiif_prezi3/helpers/create_canvas_from_iiif.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
create_canvas_from_iiif(url, anno_id=None, anno_page_id=None, **kwargs)
Create a canvas from a IIIF Image URL.
Creates a canvas from a IIIF Image service passing any kwargs to the Canvas.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
An HTTP URL at which at a IIIF Image is available. |
required |
anno_id |
str
|
An HTTP URL for the annotation to which the image will be attached. |
None
|
anno_page_id |
str
|
An HTTP URL for the annotation page to which the annotation will be attached. |
None
|
**kwargs |
see Canvas |
{}
|
Returns:
Name | Type | Description |
---|---|---|
canvas |
Canvas
|
the Canvas created from the IIIF Image. |
Source code in iiif_prezi3/helpers/create_canvas_from_iiif.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
make_canvas
MakeCanvas
Source code in iiif_prezi3/helpers/make_canvas.py
5 6 7 8 9 10 11 12 13 14 15 16 |
|
make_canvas(**kwargs)
Add a Canvas to a Manifest.
Creates a new Canvas, appends it to the calling Manifest items and returns the newly created Canvas. Accepts keyword arguments to customize the resulting instance.
Source code in iiif_prezi3/helpers/make_canvas.py
7 8 9 10 11 12 13 14 15 16 |
|
make_collection
MakeCollection
Source code in iiif_prezi3/helpers/make_collection.py
5 6 7 8 9 10 11 12 13 14 15 16 |
|
make_collection(**kwargs)
Create a Collection.
Creates a new collection, adds it to the calling Collection items
and returns the newly created object. Accepts keyword arguments to
customize the resulting instance.
Source code in iiif_prezi3/helpers/make_collection.py
7 8 9 10 11 12 13 14 15 16 |
|
make_manifest
MakeManifest
Source code in iiif_prezi3/helpers/make_manifest.py
5 6 7 8 9 10 11 12 13 14 15 16 |
|
make_manifest(**kwargs)
Add a Manifest to a Collection.
Creates a new Manifest, adds a Reference to it to the calling Collection items and returns the newly created Manifest. Accepts keyword arguments to customize the resulting instance.
Source code in iiif_prezi3/helpers/make_manifest.py
7 8 9 10 11 12 13 14 15 16 |
|
make_range
MakeRange
Source code in iiif_prezi3/helpers/make_range.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
make_range(**kwargs)
Create a Range and add it to the calling Collection or Range.
Creates a new Range, adds it to the calling object and returns the newly created Range. Accepts keyword arguments to customize the resulting instance.
Source code in iiif_prezi3/helpers/make_range.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
make_service
MakeService
Source code in iiif_prezi3/helpers/make_service.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
make_service(id, type, version=3, **kwargs)
Make a IIIF Prezi service of the desired IIIF API version and adds it to the service list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
AnyUrl
|
The id of the service. |
required |
type |
str
|
The type of the service. |
required |
version |
int
|
The API version of the service. Defaults to 3. |
3
|
**kwargs |
Arbitrary keyword arguments. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If an invalid IIIF API version is provided. |
Returns:
Name | Type | Description |
---|---|---|
service |
Union[ServiceItem, ServiceItem1]
|
A service instance of the selected version. |
Source code in iiif_prezi3/helpers/make_service.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
set_hwd
SetHwd
Source code in iiif_prezi3/helpers/set_hwd.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
set_hwd(height=None, width=None, duration=None)
Set the height, width, and duration properties allowing nulls.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
height |
int
|
The height of the resource or the canvas |
None
|
width |
int
|
The width of the resource or the canvas |
None
|
duration |
float
|
The duration of the resource |
None
|
Source code in iiif_prezi3/helpers/set_hwd.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
set_hwd_from_file
SetHeightWidthDurationFileHelper
Source code in iiif_prezi3/helpers/set_hwd_from_file.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
set_hwd_from_file(file_path_or_object)
Introspect a file and set the height, width, and duration properties.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path_or_object |
Union[str, fp]
|
the file path or file object to introspect |
required |
Source code in iiif_prezi3/helpers/set_hwd_from_file.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
set_hwd_from_iiif
SetHwdFromIIIF
Source code in iiif_prezi3/helpers/set_hwd_from_iiif.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
set_hwd_from_iiif(url)
Set height and width on a Canvas object.
Requests IIIF Image information remotely for an image resource and sets resulting height and width. This method will return the info.json
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
An HTTP URL for the IIIF image endpoint. |
required |
Source code in iiif_prezi3/helpers/set_hwd_from_iiif.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
to_reference
ToReference
Source code in iiif_prezi3/helpers/to_reference.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
to_reference()
Returns a Reference object that points to the calling object.
Source code in iiif_prezi3/helpers/to_reference.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|