Skip to main content

dimu - Digitalt Museum-klient och FastAPI-proxy

PyPI PyPI downloads Test, build, and publish Container Documentation Status

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.2

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.2
File Size Uploaded
dimu-0.2.2.tar.gz 16.9 kB Details

Built distribution (wheel)

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

Total release size: 30.8 kB

Release files / dimu-0.2.2.tar.gz

Download URL dimu-0.2.2.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a46b90ec1641641105aad8a07f66f4bc39398eb695b0144eed4217b4902f7655
BLAKE2b-256 checksum
How to use checksums
df805ad92a05801a82b2f1ff0f74f5d1202d0133e070be547cf02a8a41fb3322
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 30, 2026.

Transparency log

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

Download URL dimu-0.2.2-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9996ee44f0d5c7b50461b024ea94b28e8c5ffbe620fafb1685d9a01ee05dcd23
BLAKE2b-256 checksum
How to use checksums
00113573e8ba2b495d0cd5d33298b57fa103ad94670c58085566d5f024adec1d
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

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