Overview#
As IIIF Presentation API 3 becomes more widespread, I found it increasingly difficult to understand the specification and create JSON files directly.
So I tried using the following Python library, and this is a note for reference.
https://github.com/iiif-prezi/iiif-prezi3
I used this library for converting the data published on the Toji Hyakugo Monjo WEB to IIIF, as introduced in the following article.
The source code may be hard to read, but it is also published in the following repository, and I hope it is helpful.
https://github.com/nakamura196/toji_iiif
Creating a Collection#
I was able to create an IIIF collection with the following code.
By setting iiif_prezi3.config.configs['helpers.auto_fields.AutoLang'].auto_lang to ja, the language field of label and metadata became ja.
I also found it useful that using the iiif_prezi3.KeyValueString function outputs fields and values as arrays.
Additionally, providing iiif_prezi3.ProviderItem automatically sets "type": "Agent", which I think is an advantage of using the library.
Other Notes#
Manifests and canvases could also be created in a similar manner.
In particular, the following was helpful for specifying canvas and image sizes.
https://iiif-prezi.github.io/iiif-prezi3/recipes/0004-canvas-size/
Summary#
I hope this is helpful for using iiif-prezi3.