A Python SDK for interacting with the qube REST API and subscribing to real-time events
Project description
pyqube
Qube SDK is a Python library designed for seamless interaction with the Qube REST API and subscribing to real-time events. This SDK simplifies ticket and queue management while providing an easy-to-use interface for developers.
Installation
You can install the SDK using Poetry:
poetry add pyqube
Example Usage
Here’s a brief example demonstrating how you can use the Qube SDK to interact with both the Qube API and Event Handling:
Events
import time
from pyqube import QubeClient
from pyqube.types import Ticket
def main():
qube_client = QubeClient(api_key="your_api_key_here", location_id=1)
@qube_client.on_ticket_generated()
def handle_generated_ticket(ticket: Ticket):
print(f"Generated ticket: {ticket}")
print("Listening for events. Press Ctrl+C to exit.")
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
qube_client.disconnect()
if __name__ == "__main__":
main()
REST API
from pyqube import QubeClient
def generate_ticket(qube_client):
queue_id = 1
priority = False
ticket = qube_client.get_queue_management_manager().generate_ticket(queue_id, priority)
print(f"Generated ticket: {ticket}")
if __name__ == '__main__':
qube_client = QubeClient(api_key="your_api_key_here", location_id=1)
generate_ticket(qube_client)
Explore additional usage examples and detailed workflows in the examples directory.
- Event Handling Example: events_example.py
- REST API Example: rest_example.py
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyqube-0.1.1.tar.gz.
File metadata
- Download URL: pyqube-0.1.1.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87f895c5b6704057ee02e380c18a11740f46f8a2403de60f6810593422b8c55c
|
|
| MD5 |
38b7b3359d077214d7f4ec0a62d19d42
|
|
| BLAKE2b-256 |
7b3c64719f8d48e9583c45eda3ddbe539ed8d778852d521575bd5b5c10880de1
|
File details
Details for the file pyqube-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyqube-0.1.1-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6414f95ec83892861c9b00e063ffb341cf174186372dfc8e285651aef2c29df0
|
|
| MD5 |
00190f7e2d15eb1b9c98cf5d8e56338c
|
|
| BLAKE2b-256 |
60b32001b0cecb697f3a04fad7b6984d1f2b31091a08d1a89f6270ea75f15918
|