Skip to main content

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.

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

pyqube-0.1.2.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

pyqube-0.1.2-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file pyqube-0.1.2.tar.gz.

File metadata

  • Download URL: pyqube-0.1.2.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

Hashes for pyqube-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9fccfd10b6ac7630e53975a94845c0df55cb594e9c5275fbd8c25763e75a93ee
MD5 cc94dc8615688e28d76e2147892de068
BLAKE2b-256 4fa672ab18bebc40eceacd94fa1068d456ce4c4d76122956373d4384d43a7614

See more details on using hashes here.

File details

Details for the file pyqube-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyqube-0.1.2-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

Hashes for pyqube-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b84a35bba0c3a5e91d874cca62f0d0d98d5052db0a7e371213204c7bf46ccc6
MD5 0c38e9e305106f4c2d048f985e51aacf
BLAKE2b-256 a5fc17afd50d2f65d3020f0262a2ac1d128c059e8c99fa3103f9a2006f6cf143

See more details on using hashes here.

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