Skip to main content

dirigent-dhis2

Documentation: https://winterop-com.github.io/dirigent-dhis2/

The DHIS2 adapter pack for dirigent. It contributes the dhis2 connection kind, two JSON Schema formats (dhis2-uid and dhis2-period), and the blocks that speak DHIS2's asynchronous jobs, import summaries, completeness registrations, metadata, tracker and analytics reads as first-class steps, rather than composing them out of raw HTTP:

Block Kind What it does
dhis2.analytics_run operator Submits the analytics tables job and follows its task notifications to the end.
dhis2.analytics_query operator Runs one analytics query, aggregate or event/enrollment, and hands the grid on.
dhis2.data_value_set_export operator Reads a data value set for a data set, period and org unit, and hands the document on.
dhis2.data_value_set_import operator Imports a data value set, parsing the import summary and its conflicts.
dhis2.metadata operator Reads one metadata collection through the version-bound generic accessor.
dhis2.tracker operator Reads a page of tracked entities, enrollments or events from /api/tracker.
dhis2.data_set_complete sensor Holds a run until a data set is marked complete for the period.

Every block classifies its failures the dhis2w-client way: an instance whose version the client does not speak is refused rather than retried, and a transport failure is transient.

An instance discovers the pack by installing it: the dirigent.plugins.v1 entry point in pyproject.toml is the whole registration.

Install

Install the pack into the dirigent image:

uv pip install dirigent-dhis2

or add it to a project:

uv add dirigent-dhis2

Develop

uv sync --locked
uv run ruff format --check . && uv run ruff check .
uv run mypy && uv run pyright
uv run pytest

That is what CI runs. The lock file is committed and CI syncs against it, so a pack build is reproducible; the ecosystem's nightly integration is what proves the pack against the

tests/ exercises every block against a mocked DHIS2 instance, and tests/test_examples.py validates the example documents against the pack's own catalog. The examples run standalone, each carrying the connection it uses.

Examples

The shelves are installed with the pack: dirigent_dhis2 contributes them through the examples() hook, so an instance with the pack installed lists them with

dg examples list --plugin dhis2
dg examples list --plugin dhis2 --starter

They live in src/dirigent_dhis2/shelves/, and the root examples/ is a symlink to it so dg run --local examples/... reads from a checkout.

One file per operation, grouped by how it is built:

Shelf What is in it
dhis2/ The native adapter: exports and their import strategies, the sign-off gate, the analytics reads and rebuilds, the three tracker collections, the metadata reads.
dhis2-compose/ A dhis2.* block beside one of the engine's own: a schema gate, a jq reshape, a fan-out over org units, a write to storage and the read back.
dhis2-http/ The generic-HTTP way, for what no adapter covers: a CSV export, a period range, a completion registration, a stage-scoped event read.
validate/ A metadata read held to a shape: a fields= projection gated on validate.schema, with the schema carried and named.
schemas/ The JSON Schemas that pin the reads the DHIS2 series makes, applied on their own.
starters/ The documents tagged starter: the same flows naming a dhis2 connection rather than carrying one, which is what dg pipeline new copies into a project.

Each shelf's README lists its files one line each. Every shelf but starters/ carries the connection it uses so each document runs standalone; a server refuses a carried connection, so the starters are the ones an instance accepts unedited.

Licence

Copyright (c) 2026 Morten Olav Hansen. All rights reserved. See LICENSE.

The source is published for reference only: no licence to use, copy, modify or distribute it is granted, and any use beyond reading requires written permission.

Release files for dirigent-dhis2 0.15.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 dirigent-dhis2 0.15.2
File Size Uploaded
dirigent_dhis2-0.15.2.tar.gz 69.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dirigent-dhis2 0.15.2
File Interpreter ABI Platform
dirigent_dhis2-0.15.2-py3-none-any.whl Python 3 none any Details

Total release size: 196.0 kB

Release files / dirigent_dhis2-0.15.2.tar.gz

Download URL dirigent_dhis2-0.15.2.tar.gz
Size 69.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8639165ef2adb5096eb8f5a8983e6221a17bca03d3f50f6328785b70273a1fee
BLAKE2b-256 checksum
How to use checksums
4ad6fa13d748d28917cebea10eccf28764a4b5357cd1602a29537ccf15b41696
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 12, 2026.

Transparency log

Release files / dirigent_dhis2-0.15.2-py3-none-any.whl

Download URL dirigent_dhis2-0.15.2-py3-none-any.whl
Size 126.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2290c58b1dcadb391fee68da72014c0a1e92cbcbc1db541b9a2d000a0de65c2
BLAKE2b-256 checksum
How to use checksums
d8ac261aecb6b6754549827ff566c78e1453fb5069aa23118cc50f457e6a4c4b
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.18.0

2 release files

0.17.3

2 release files

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.7

2 release files

0.16.6

2 release files

0.16.5

2 release files

0.16.4

2 release files

0.16.3

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.16.0

2 release files

This release

0.15.2 This release

2 release files

0.15.1

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

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