Skip to main content

dimu - Digitalt Museum-klient och FastAPI-proxy

dimu är en transparent Python-klient och en valfri FastAPI-proxy för DigitaltMuseums publika API. Indata valideras med Pydantic, men lyckade sök- och objektsvar lämnas orörda.

from dimu import DimuClient, SearchRequest, SearchTerm

with DimuClient() as client:  # använder demo och varnar om DIMU_API_KEY saknas
    response = client.search(SearchRequest(query="Uppsala slott", limit=5))
    response.raise_for_status()
    print(response.json())

Installera biblioteket med pip install dimu. För HTTP-tjänsten används pip install "dimu[api]" och följande miljövariabler:

DIMU_API_KEY=<valfri produktionsnyckel från DigitaltMuseum>
DIMU_SERVICE_TOKEN=<lång slumpmässig token>

Starta sedan tjänsten:

uvicorn dimu.api:app --host 127.0.0.1 --port 8000

För en Ubuntu-server med Supervisor, Nginx och Let's Encrypt:

sudo DIMU_SERVICE_TOKEN='byt-mig' DIMU_API_KEY='demo' \
  bash deploy/ubuntu.sh api.example.se admin@example.se

En container kan byggas med docker build -t dimu . och köras med docker run --rm -p 8000:8000 -e DIMU_SERVICE_TOKEN='byt-mig' dimu. GitHub Actions publicerar Git-taggen och latest till GitHub Container Registry och skapar en GitHub Release när en Git-tagg pushas. Varje release innehåller linux/amd64 och linux/arm64.

Den publicerade imagen är publik och kan hämtas utan inloggning:

docker pull ghcr.io/nedomkull-mathematical-modeling/digitaltmuseum-ai:latest

Fullständig dokumentation på svenska och norskt bokmål finns i katalogen docs/ och byggs med mkdocs build --strict. Tester körs med python -m unittest discover -s tests -v.

Programvaran är licensierad under MIT. Metadata och bilder får återanvändas enligt licensen i respektive post. Paketet är ingen lokal spegel och lagrar inte DigitaltMuseums data.

Metadata

Release files for dimu 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dimu 0.2.1
File Size Uploaded
dimu-0.2.1.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dimu 0.2.1
File Interpreter ABI Platform
dimu-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.8 kB

Release files / dimu-0.2.1.tar.gz

Download URL dimu-0.2.1.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b7007304372f78a099f19624c48a5177a99bcb445a305f4e197fdb364ee23721
BLAKE2b-256 checksum
How to use checksums
5ed00558267c2cf13fd8ff0da8d775b1950010986c485100c87e44e9247b6309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / dimu-0.2.1-py3-none-any.whl

Download URL dimu-0.2.1-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06784a8e92b31f35d54b5e172486bcceffc3bd572b5e415d0c2ad90d0370dc34
BLAKE2b-256 checksum
How to use checksums
9e0e3a8d02c2ee024297d016631355625265cf284540fa8cb4148ddb2f022aaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page