Skip to content

dhis2w-client API reference

Learning path · step 6 of 8 — Reference + edge cases. Prev: Examples index. Next: Architecture overview. For prose explanations with worked examples, the dhis2w-client step-by-step guide is the better starting point — this page is the auto-rendered surface for symbol-by-symbol lookups.

Auto-generated from the dhis2w-client source via mkdocstrings. Every class, method, and function listed here is importable from dhis2w_client (top-level re-exports) or from its module.

Layout

  • Client + lifecycle — Dhis2Client, connect, close, raw escape hatches
  • Profile + lightweight open_client — Profile, open_client, build_auth_provider, profile_from_env_raw, exceptions — PAT/Basic/session library path with no dhis2w-core install
  • Auth providers — BasicAuth, PatAuth, OAuth2Auth, SessionCookieAuth, the AuthProvider Protocol, OAuth2Token, TokenStore
  • Errors — the exception hierarchy
  • Envelopes + responses — WebMessageResponse, Conflict, ImportCount, ObjectReport, ImportReport
  • Route auth schemes — the 5-variant discriminated AuthScheme union
  • Sharing — typed SharingObject + SharingBuilder + get_sharing / apply_sharing helpers over /api/sharing
  • Generated-model helpers — Dhis2 enum, available_versions, load
  • OpenAPI-derived models — the 980+ classes emitted under generated/v43/oas/ from /api/openapi.json
  • System module — Me, SystemInfo, SystemModule
  • Tracker reads — instance models, status enums
  • Aggregate — DataValue, DataValueSet, completeness registrations + their read accessor
  • Data values (import + export) — DataValuesAccessor on Dhis2Client.data_values (streaming imports, typed export, client.stream to a sink)
  • Analytics — Grid, GridHeader (OAS-emitted) + AnalyticsMetaData (typed parser helper over Grid.metaData)
  • Analytics streaming — AnalyticsAccessor on Dhis2Client.analytics (pivot, event + enrollment line lists, chunked /api/analytics* downloads)
  • Maintenance — Notification, DataIntegrityCheck, DataIntegrityResult, DataIntegrityReport
  • Metadata accessor — MetadataAccessor on Dhis2Client.metadata (bulk delete + multi-resource operations)
  • Customize — CustomizeAccessor, LoginCustomization, CustomizationResult
  • Files — FilesAccessor, Document, FileResource, FileResourceDomain — documents + file-resource uploads/downloads
  • Messaging — MessagingAccessor on Dhis2Client.messaging (/api/messageConversations)
  • Apps — AppsAccessor on Dhis2Client.apps — install / uninstall / update over /api/apps + /api/appHub
  • Validation + predictors — ValidationAccessor + PredictorsAccessor for the run-rules + run-predictors workflow
  • Visualizations + dashboards — VisualizationsAccessor + VisualizationSpec + DashboardsAccessor + DashboardSlot for authoring saved analytics + composing dashboards
  • Maps — MapsAccessor + MapSpec + MapLayerSpec for thematic choropleths + map composition
  • Legend sets — LegendSetsAccessor + LegendSetSpec + LegendSpec — colour-range authoring attached to visualizations and maps
  • Organisation units — OrganisationUnitsAccessor + OrganisationUnitGroupsAccessor + OrganisationUnitGroupSetsAccessor + OrganisationUnitLevelsAccessor — tree-aware reads, per-level naming, group + group-set membership
  • Data elements — DataElementsAccessor + DataElementGroupsAccessor + DataElementGroupSetsAccessor — aggregate + tracker DE authoring, thematic groups, analytics dimensions
  • Indicators — IndicatorsAccessor + IndicatorGroupsAccessor + IndicatorGroupSetsAccessor — computed-ratio authoring with expression validation, per-item membership shortcuts
  • Program indicators — ProgramIndicatorsAccessor + ProgramIndicatorGroupsAccessor — tracker-analytics authoring (pair only; DHIS2 doesn't expose a ProgramIndicatorGroupSet)
  • Categories — CategoriesAccessor + Category — second tier of disaggregation: named axis groupings of CategoryOptions
  • Category combos — CategoryCombosAccessor + CategoryCombo — cross-product disaggregation attached to DataElements; v43 manual-COC-regen helper
  • Category combo builder — build_category_combo + CategoryComboBuildSpec — declarative one-call Categories → CategoryCombo → COCs build
  • Category option combos — read-only CategoryOptionCombosAccessor — enumerate the materialised disaggregation cells of a CategoryCombo
  • Category options — CategoryOptionsAccessor + CategoryOptionGroupsAccessor + CategoryOptionGroupSetsAccessor — disaggregation values + validity windows + analytics dimensions
  • Attribute values — AttributeValuesAccessor — read + write the typed attributeValues field on any metadata resource
  • Option sets — OptionSetsAccessor + OptionSpec + UpsertReport — controlled-vocabulary option lists with declarative sync
  • Program rules — ProgramRulesAccessor — program-rule reads, variable resolution, expression validation, reverse-reference lookup
  • JSON Patch ops — JsonPatchOp + JsonPatchOpAdapter — typed RFC 6902 ops for PATCH /api/{resource}/{uid}
  • Tasks module — TaskModule + TaskCompletion + TaskPoll — block on DHIS2 background jobs, or read their feed one poll at a time
  • SQL views — SqlViewsAccessor + SqlViewRunner for DHIS2 SqlView execution workflows
  • Periods — PeriodType StrEnum
  • UIDs — client-side UID generator + validator