Skip to main content

Minimal Zabbix JSON-RPC API client (httpx-based)

Project description

zapi-lib

Minimal Zabbix JSON-RPC API client for Python — a thin, httpx-only wrapper around the single /api_jsonrpc.php endpoint.

Spun out of zapi-mcp so that tools which only need the API client — e.g. speedtest-z — can depend on it without pulling in the MCP server stack (mcp, starlette, uvicorn, …).

Features

  • Version-adaptive auth: user + auth field (Zabbix ≤ 6.2) and username + Authorization: Bearer (6.4 / 7.0), degrading to the proven path automatically.
  • Read helpers: get_hosts, get_items, get_problems, count_problems, get_events.
  • Write helpers: set_host_tag (idempotent host-tag upsert that preserves other tags), acknowledge_problem.
  • A single runtime dependency: httpx.

Install

pip install zapi-lib

Usage

from zapi_lib import ZapiClient, tag_filter

with ZapiClient("https://zabbix.example.com", "api-user", "api-pass") as z:
    hosts = z.get_hosts(tags=[tag_filter("speedtest-z")])
    z.set_host_tag("eduroam", "speedtest-z", "0.10.0")

The URL may be given with or without the /api_jsonrpc.php suffix.

License

MIT

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

zapi_lib-0.2.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

zapi_lib-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file zapi_lib-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for zapi_lib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c8aba88610a70179ea65ba79a33870c7d233aa6a818922ff3bfb2e0c17cc832f
MD5 651be922eaffc76693e7fdf77d098d6c
BLAKE2b-256 693eb8474ebbc522aeb464da81b718a895ec2be8df44830d4adce09a61105d37

See more details on using hashes here.

Provenance

The following attestation bundles were made for zapi_lib-0.2.0.tar.gz:

Publisher: release.yml on shigechika/zapi-lib

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

File details

Details for the file zapi_lib-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for zapi_lib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f4c81232ab6047a846a2848cb95545be56edd288d5008e349d1699e40a23fd2
MD5 20db912c8a1ab976f1ce7c2cd8481497
BLAKE2b-256 b89eb15d3594da83608731283da3d7818de320096c2d1e308884d1aeb37dd292

See more details on using hashes here.

Provenance

The following attestation bundles were made for zapi_lib-0.2.0-py3-none-any.whl:

Publisher: release.yml on shigechika/zapi-lib

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