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.

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

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.0
File Size Uploaded
dimu-0.2.0.tar.gz 16.0 kB Details

Built distribution (wheel)

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

Total release size: 29.5 kB

Release files / dimu-0.2.0.tar.gz

Download URL dimu-0.2.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a6d620bc5a1f6a793818529715fbf3347de1c9826dfd88c395f5ee7e0a9a1f9b
BLAKE2b-256 checksum
How to use checksums
0d774ba4289c7b406ecb11c918d22ce115349629bdf982e02478192d4798ce92
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.0-py3-none-any.whl

Download URL dimu-0.2.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49b538d4102fc281d2d6f02a9dc734b21686e4be4e319fbd4ca230b1dd908830
BLAKE2b-256 checksum
How to use checksums
6b518c3fe670a9de95837d665072bb04b0c3bd9d15b9d3697ec639eedabdec48
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

0.2.1

2 release files

This release

0.2.0 This release

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