pyznuny
A Python client for interacting with the Znuny ticketing system API.
Features
- Simple, typed client built on httpx
- Ticket create, update, and get routes
- Easy custom endpoint configuration
Installation
pip install pyznuny
Or with uv:
uv add pyznuny
Documentation
For a complete API Reference and guide on how to use pyznuny, please visit our documentation
Quick start
Create a client and authenticate using environment variables.
from pyznuny import TicketClient
from dotenv import load_dotenv
import os
load_dotenv()
client = TicketClient(
base_url=os.getenv("HOST"),
username=os.getenv("USER_LOGIN"),
password=os.getenv("PASSWORD"),
)
Example .env:
HOST=https://your-znuny-instance.com
USER_LOGIN=your-username
PASSWORD=your-password
Usage examples
Create a ticket
payload = {
"Ticket": {
"Title": "Ticket Title",
"Queue": "Ticket queue",
"State": "Ticket state",
"Priority": "Ticket priority",
"CustomerUser": "customer@example.com",
},
"Article": {
"Subject": "Ticket subject",
"Body": "Ticket body...",
"ContentType": "text/plain; charset=utf-8",
"From": "customer@example.com",
},
}
response = client.ticket.create(payload=payload)
print(response.json())
Get a ticket by ID
# default endpoint is GET /Ticket/{ticket_id}
response = client.ticket.get(ticket_id=1234)
print(response.json())
Update a ticket
response = client.ticket.update(
ticket_id=1234,
Ticket={"State": "open"},
)
print(response.json())
Customize endpoints
If your Znuny instance uses different paths, set them with the endpoint setter.
# Example: custom ticket get endpoint and identifier
client.set_endpoint.ticket_get(endpoint="Tickets/{id}", identifier="id")
response = client.ticket.get(ticket_id=1234)
Notes
- When
usernameandpasswordare provided, the client logs in and storessession_idautomatically. - You can pass a pre-configured
httpx.Clientviaclient=...if needed. - You can send payloads as plain dicts using the same attributes shown in the examples.
Metadata
Release files for pyznuny 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyznuny-1.1.0.tar.gz | 13.5 kB | Without provenance | Details for pyznuny-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyznuny-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyznuny-1.1.0-py3-none-any.whl |
Total release size: 24.3 kB
Release files / pyznuny-1.1.0.tar.gz
| Download URL | pyznuny-1.1.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8dc0c658834c10923fe79fd3be0192430dec491df833ea976ef645cfe3066984
|
|
BLAKE2b-256 checksum How to use checksums |
1773cf66005aff5b98ec689fa085228556a7edb075e7d40c26b193c1dcd7f56e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pyznuny-1.1.0-py3-none-any.whl
| Download URL | pyznuny-1.1.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
951171763d574bbe8cffa36bf55169c35a92ee0284e251d873fdb2a66712bf3e
|
|
BLAKE2b-256 checksum How to use checksums |
d32c3862505dc87c14b8f1809bc0d2081ec5ce8474a5bd6c5af7994fc5808e8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for pyznuny 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.