Architecture

How the Znuny Python SDK is structured and how it talks to GenericInterface.

Architecture — Znuny Python SDK

The znuny PyPI package is a Znuny-branded layer over a shared GenericInterface client implementation.

flowchart LR
  App[Your Python app] --> Znuny[znuny package]
  Znuny --> GI[otrs_gi_core]
  GI --> REST[Znuny GenericInterface REST]
  CLI[znuny-cli] --> GI

What you import

from znuny import ZnunyClient, ClientConfig, TicketCreate, ZnunyError

ZnunyClient is the async HTTP client. Domain models (TicketCreate, TicketSearch, …) are Pydantic v2 types validated before each request.

Request flow

  1. You call client.login(BasicAuth(...)).
  2. Each method builds a JSON payload (credentials + ticket data).
  3. The client POSTs/PUTs to {base_url}/Webservice/{name}/{operation}.
  4. Responses are parsed into Ticket models or raise ZnunyError.

Znuny-specific defaults

AreaZnuny behavior
CLIznuny-cli uses Znuny console paths (otrs.Console.pl)
Setup wizardDetects Znuny installations for webservice import
Public APIZnunyClient, ZnunyError, setup_znuny_system

The HTTP protocol and ticket models match what Znuny exposes through GenericInterface — the same OTRS-family API Znuny inherited.

CLI vs library

ComponentPurpose
ZnunyClientRuntime ticket CRUD from your application
znuny-cli setup-systemOne-time webservice and user provisioning on the Znuny server

Further reading