The purpose of this repository is to develop a script that can generate IIIF Presentation API 3.0 resources for DaSCH - Swiss National Data and Service Center for the Humanities leveraging the iiif-prezi3 Python library.
This tool aims to upgrade the experimental and outdated IIIF Manifests feature previously available.
As a first experiment, IIIF Manifests have been created for the Bernoulli-Euler Online (BEOL) project.
This repository includes a Python script and a Flask web server that serves as an interface for specifying the manifest server URL.
-
Prepare the Environment: Clone the repository and navigate to the project directory.
git clone https://github.com/dasch-swiss/daschiiify.git cd daschiiify
-
Prepare SSL Certificates: The server uses HTTPS, so you'll need to generate a private key and a self-signed certificate. Store these in the
certs
directory.mkdir -p certs openssl genrsa -out certs/key.pem 2048 openssl req -new -key certs/key.pem -out certs/cert.csr openssl req -x509 -days 365 -key certs/key.pem -in certs/cert.csr -out certs/cert.pem
-
Install Dependencies: Make sure Python and Docker are installed on your system. Build the Docker image using the provided Dockerfile.
docker build -t daschiiify .
Building locally with the build environment
docker build --build-arg BUILD_ENV=dev -t daschiiify .
-
Run the Docker Container: Start the container which runs the Flask server.
docker run -p 5000:5000 daschiiify
-
Access the Server: Open a web browser and navigate to https://127.0.0.1:5000. This will display the user interface.
- Enter the Manifest Server URL: Input the URL of the manifest server in the form provided. This URL is used by the script to generate IIIF manifests.
- Generate Resources: Click the 'Generate IIIF Resources' button to start the resource generation process using the specified
manifest_server
URL and data frombeol.csv
. - Amend JSON Files: Click 'Amend JSON Files by setting the correct HTTPS URL from SIPI' to adjust the URLs in the generated JSON files from HTTP to HTTPS, preventing mixed content issues.
The Dockerfile provided in this repository uses a multi-stage build process to optimize the size of the final Docker image. It separates the build environment from the production environment, resulting in a smaller image size.
- build_release: This stage sets up the build environment, installs dependencies, and prepares the application for production.
- build_dev: In this stage, additional files specific to development, such as data directories, are added to the image.
- Final Image Selection: The final image is selected based on the value of the
BUILD_ENV
argument provided during the build process. IfBUILD_ENV=release
, the build_release stage is used; otherwise, thebuild_dev
stage is selected.
The generated IIIF manifests are stored in the data/0801
directory within the container, accessible through the Flask server. Future updates may include additional functionalities or output handling options.
For the moment, only IIIF Manifests for the BEOL project can be generated, but it is intended that the script will be amended to accomodate different projects hosted on the DaSCH Service Platform