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.3.0.tar.gz (22.9 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.3.0-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqube-0.3.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyqube-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f145ccd4071f612ee512714478cc5b4408315aab52a1435b241607ea5d7d89e1
MD5 78f3347e19975d83c30aa96fca4768a4
BLAKE2b-256 15f07f0fa6d3425f34ee7137927c7d720810cf53bdba3fd78c0e1f83e8a100f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqube-0.3.0.tar.gz:

Publisher: python-publish.yml on Q-Better/pyqube

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

File details

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

File metadata

  • Download URL: pyqube-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyqube-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a85f1d2fb8ef763b840c45bd440cabdf65c7668d1c14b7d0cafcb0ab706f0d6
MD5 e65636acc733e7e7b880529fc0f4ef46
BLAKE2b-256 f757b826107887d6492ec28bcaa51e7bd9287ec767b34b92526c42bd55c32cfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqube-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on Q-Better/pyqube

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