REST API

dcclib-rest-api is a Flask / APIFlask application that exposes the full dcclib feature set over HTTP.

Running the server

With uv (development)

uv run --package dcclib-rest-api api

The server starts on http://127.0.0.1:5000 by default.

With Docker

docker run --rm -p 8080:8080 \
  registry.gitlab1.ptb.de/d-ptb/dcc/dcclib/rest-api:latest

Configuration

The server reads an optional configuration file pointed to by the FLASK_CONFIG_FILE environment variable. See dcclib_rest_api.config.Config for available settings.


OpenAPI documentation

The full interactive OpenAPI (Swagger UI) reference (every endpoint, parameter, and request/response schema) is available on the REST API Reference page.

Once the server is running, the same documentation is also served live (with try-it-out request execution) at:

http://<host>:<port>/docs

The / endpoint returns a JSON summary of the running API:

{
  "title": "DCCLib REST-API",
  "description": "REST-API for the DCCLib library.",
  "version": "0.3.0",
  "docs": "/docs"
}

Endpoints overview

Module Endpoints
dccs Upload and retrieve DCC files
validate XSD schema validation, Schematron validation
convert XML → JSON conversion
transform XSLT transformation
extract / files List and download Base64-embedded attachments
extract / formulae Parse and evaluate MathML formulas
signature Sign and verify XML digital signatures

Caching

The REST API uses diskcache to cache parsed DCC objects between requests, reducing repeated parsing overhead when the same file is submitted multiple times.