Skip to main content

Shared DHIS2 tooling runtime: profile discovery, plugin registry, auth factory, token store, first-party plugins.

Project description

dhis2w-core

Shared runtime for dhis2w-cli and dhis2w-mcp: profile discovery, plugin registry, auth factory, token store, and the first-party plugins (metadata, data, analytics, users, tracker, files, messaging, apps, route, maintenance, doctor, customize, system, profile, dev).

dhis2w-core is the bridge between dhis2w-client (the pure async API client) and the user-facing surfaces (CLI, MCP). End users typically don't install this directly — they install dhis2w-cli or dhis2w-mcp which pull dhis2w-core in transitively.

Install

# Direct (rare — usually you want dhis2w-cli or dhis2w-mcp instead)
uv add dhis2w-core

What's in the box

  • Profile system — auto-discovers a profile from .dhis2/profiles.toml (CWD walk-up) or ~/.config/dhis2/profiles.toml. Profile model + profile_from_env() env-var fallback.
  • Plugin registry — walks dhis2w_core.v{41,42,43}.plugins.* plus entry_points("dhis2.plugins") for external plugins. Each plugin exposes register_cli(app) and register_mcp(server).
  • Auth factory — turns a Profile into the matching AuthProvider from dhis2w-client, wires the token store, manages OAuth2 PKCE redirect capture.
  • Token store — SQLite-backed (aiosqlite) at .dhis2/tokens.sqlite, keyed by profile name.
  • open_client(profile) context manager — the canonical "give me a connected client" entry point for plugin services.

Plugins shipped

metadata, data, analytics, tracker, user, user_group, user_role, route, apps, messaging, files, maintenance, doctor, customize, system, profile, dev, browser (CLI-only, opt-in via [browser] extra).

Each plugin lives at packages/dhis2w-core/src/dhis2w_core/v{41,42,43}/plugins/<name>/ (per-version subpackage; one tree per DHIS2 major) with service.py (typed business logic), cli.py (Typer commands), and mcp.py (FastMCP tools) — both surfaces call the same service.py.

Documentation

Full architecture: https://winterop-com.github.io/dhis2w-utils/architecture/overview/.

dhis2w-core is one member of the dhis2w-utils workspace.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dhis2w_core-0.21.0.tar.gz (667.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dhis2w_core-0.21.0-py3-none-any.whl (863.8 kB view details)

Uploaded Python 3

File details

Details for the file dhis2w_core-0.21.0.tar.gz.

File metadata

  • Download URL: dhis2w_core-0.21.0.tar.gz
  • Upload date:
  • Size: 667.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhis2w_core-0.21.0.tar.gz
Algorithm Hash digest
SHA256 4f040669cac0377b19116ead869352c7789f3c7d831fc3975bcd98ece74e5eb2
MD5 1d914413f4992b755742bf6d0795a277
BLAKE2b-256 d9f083ea8afea9bd0ae8cd580e6c7d0f215fb55dd04e1ad8091f20a27c838cec

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhis2w_core-0.21.0.tar.gz:

Publisher: pypi-publish.yml on winterop-com/dhis2w-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhis2w_core-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: dhis2w_core-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 863.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhis2w_core-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2f51f0d6c3c467f9f8d1ea485c06ba116aa087fa97bd4aa52d91000c449f88
MD5 6a9e1aae13812d40dcf3d5e69e3346cc
BLAKE2b-256 ddcbb31d212beb9acf291bfe68589a8679d7bcf3c858661de4bfcb8b3cb1d08f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhis2w_core-0.21.0-py3-none-any.whl:

Publisher: pypi-publish.yml on winterop-com/dhis2w-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page