Skip to content

dhis2w-client API reference

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.

For prose explanations with worked examples, see the dhis2w-client step-by-step guide.

Layout

  • Client + lifecycleDhis2Client, connect, close, raw escape hatches
  • Auth providersBasicAuth, PatAuth, OAuth2Auth, the AuthProvider Protocol, OAuth2Token, TokenStore
  • Errors — the exception hierarchy
  • Envelopes + responsesWebMessageResponse, 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 helpersDhis2 enum, available_versions, load
  • OpenAPI-derived models — the 562+ classes emitted under generated/v42/oas/ from /api/openapi.json
  • System moduleMe, SystemInfo, SystemModule
  • Tracker reads — instance models, status enums
  • AggregateDataValue, DataValueSet
  • Data values (streaming)DataValuesAccessor on Dhis2Client.data_values (streaming /api/dataValueSets imports)
  • AnalyticsGrid, GridHeader (OAS-emitted) + AnalyticsMetaData (typed parser helper over Grid.metaData)
  • Analytics streamingAnalyticsAccessor on Dhis2Client.analytics (chunked /api/analytics* downloads)
  • MaintenanceNotification, DataIntegrityCheck, DataIntegrityResult, DataIntegrityReport
  • Metadata accessorMetadataAccessor on Dhis2Client.metadata (bulk delete + multi-resource operations)
  • CustomizeCustomizeAccessor, LoginCustomization, CustomizationResult
  • FilesFilesAccessor, Document, FileResource, FileResourceDomain — documents + file-resource uploads/downloads
  • MessagingMessagingAccessor on Dhis2Client.messaging (/api/messageConversations)
  • AppsAppsAccessor on Dhis2Client.apps — install / uninstall / update over /api/apps + /api/appHub
  • Validation + predictorsValidationAccessor + PredictorsAccessor for the run-rules + run-predictors workflow
  • Visualizations + dashboardsVisualizationsAccessor + VisualizationSpec + DashboardsAccessor + DashboardSlot for authoring saved analytics + composing dashboards
  • MapsMapsAccessor + MapSpec + MapLayerSpec for thematic choropleths + map composition
  • Legend setsLegendSetsAccessor + LegendSetSpec + LegendSpec — colour-range authoring attached to visualizations and maps
  • Organisation unitsOrganisationUnitsAccessor + OrganisationUnitGroupsAccessor + OrganisationUnitGroupSetsAccessor + OrganisationUnitLevelsAccessor — tree-aware reads, per-level naming, group + group-set membership
  • Data elementsDataElementsAccessor + DataElementGroupsAccessor + DataElementGroupSetsAccessor — aggregate + tracker DE authoring, thematic groups, analytics dimensions
  • IndicatorsIndicatorsAccessor + IndicatorGroupsAccessor + IndicatorGroupSetsAccessor — computed-ratio authoring with expression validation, per-item membership shortcuts
  • Program indicatorsProgramIndicatorsAccessor + ProgramIndicatorGroupsAccessor — tracker-analytics authoring (pair only; DHIS2 doesn't expose a ProgramIndicatorGroupSet)
  • Category optionsCategoryOptionsAccessor + CategoryOptionGroupsAccessor + CategoryOptionGroupSetsAccessor — disaggregation values + validity windows + analytics dimensions
  • SQL viewsSqlViewsAccessor + SqlViewRunner for DHIS2 SqlView execution workflows
  • PeriodsPeriodType StrEnum
  • UIDs — client-side UID generator + validator