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.2.0.tar.gz (22.6 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.2.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqube-0.2.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyqube-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c165efee9811ed5e4c1b71d1fdbbd6774d0c341188e949a13a67fde8654bd4e9
MD5 3cacc29b5d02c5c2a577b2fbd0bc63a5
BLAKE2b-256 8a17ba500b1d630b378c6ba61a79300e76e8545706eea5ea5500f8f9d1f66440

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqube-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyqube-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyqube-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04a9b7e270c31b2842c494264c6d175222e62f96ebae463ece6e27f57f7401f1
MD5 c2a41dacf36c0dcb55fd106146393d81
BLAKE2b-256 72d0e841773436734b250b461dd7107c5b66347b66e2412742bc3407b26673a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqube-0.2.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