Over the last couple of years I've been fiddling with bits of Python code to work with the Omeka S REST API. The Omeka S API is powerful, but the documentation is patchy, and doing basic things like uploading images can seem quite confusing. My code was an attempt to simplify common tasks, like creating new items.
In case it's of use to others, I've now shared my code as a Python package. So you can just `pip install omeka-s-tools` to get started. The code helps you:
- download lists of resources
- search and filter lists of items
- create new items
- create new items based on a resource template
- update and delete resources
- add media to items
- add map markers to items (assuming the Mapping module is installed)
- upload templates exported from one Omeka instance to a new instance
There's quite detailed documentation available, including an example of adding a newspaper article from Trove to Omeka. If you want to see the code in action, there's also a notebook in the Trove newspapers section of the GLAM Workbench that uploads newspaper articles (including images and OCRd text) to Omeka from a variety of sources, including Trove searches, Trove lists, and Zotero libraries.
If you find any problems, or would like additional features, feel free to create an issue in the GitHub repository. #dhhacks
This is a companion discussion topic for the original entry at https://updates.timsherratt.org/2022/02/17/omeka-s-tools.html