Skip to main content

dirigent-dhis2

PyPI Python CI Release Docs

Documentation: https://winterop-com.github.io/dirigent-dhis2/. New to dirigent and DHIS2 together? The tutorial is one read, one schema gate and one rehearsed write against the public play demo, end to end.

The DHIS2 adapter pack for dirigent. It contributes the dhis2 connection kind, three JSON Schema formats (dhis2-uid, dhis2-period and dhis2-code), 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.message operator Sends a DHIS2 message to users, user groups or org units, which the instance also emails where SMTP is configured.
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.

Where a block takes DHIS2's own query terms, either shape does: fields, filter and order each accept one string, spelled as the API spells it -- id,name,valueType, level:eq:2, name:asc -- or a list, which the pack comma-joins or repeats as the resource wants.

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

or beside a tool-installed dg, or once without installing anything:

uv tool install dirigent-cli --with dirigent-dhis2
uvx --from dirigent-cli --with dirigent-dhis2 dg dev

The command is in dirigent-cli, so uvx always takes --from dirigent-cli. The pack pins its dirigent packages at its own version, so a pinned install names the same release for both.

Develop

uv sync --locked
uv run ruff format --check . && uv run ruff check .
uv run mypy && uv run pyright
uv run pytest
NO_MKDOCS_2_WARNING=1 uv run mkdocs build --strict

That block is what CI runs on every push and pull request. The variable silences Material's notice about MkDocs 2.0. 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 still composes with every other pack in one catalog.

The tutorial is published as a page and as paper. The PDF is printed from the built site with headless Chromium, lands in site/, and is never committed. The pages workflow prints it on every push to main, from the site it has just built; locally it is both steps:

uv run --with playwright playwright install chromium
uv run --with playwright python scripts/docs_pdf.py

tests/ exercises every block against a mocked DHIS2 instance, and tests/test_examples.py validates the example documents against the pack's own catalog. Every document runs standalone, 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.

Each shelf's README lists its files one line each. Every document carries the connection it uses, coded dhis2-demo, so it runs standalone; a server refuses a carried connection, so what an instance applies is a copy that names it instead. The seven documents tagged starter are the flows dg pipeline new makes that copy from, dropping the connections: block and naming dhis2-demo under requires.connections.

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.

Metadata

Release files for dirigent-dhis2 0.28.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 dirigent-dhis2 0.28.0
File Size Uploaded Provenance Actions
dirigent_dhis2-0.28.0.tar.gz 85.2 kB With provenance Details for dirigent_dhis2-0.28.0.tar.gz

Built distribution (wheel)

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

Total release size: 224.8 kB

Release files / dirigent_dhis2-0.28.0.tar.gz

Download URL dirigent_dhis2-0.28.0.tar.gz
Size 85.2 kB
Tags Source
SHA-256 checksum
How to use checksums
013d537ae3b6972520634788455223d35f5ba2c7c9e2b556ae2c4216fb8f6751
BLAKE2b-256 checksum
How to use checksums
b584064aff8c24c9eaf755bc8305b7edfab705e7a24851e5fcdcb812d8dbadb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 31, 2026.

Transparency log

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

Download URL dirigent_dhis2-0.28.0-py3-none-any.whl
Size 139.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bbfdacfdeb459d08be99cb9d3f4fa458a2a67e47f3d33c59eae978fcd501a5b
BLAKE2b-256 checksum
How to use checksums
a3bf132143c02c291ce69fbbfe4b439101886f989771f4a0eb8d977997b6ef44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 31, 2026.

Transparency log

Security for dirigent-dhis2 0.28.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dirigent_dhis2-0.28.0.tar.gz

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 Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.28.0 This release

2 release files Full provenance

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