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.1.tar.gz (23.0 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.1-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqube-0.3.1.tar.gz
  • Upload date:
  • Size: 23.0 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.1.tar.gz
Algorithm Hash digest
SHA256 0c55b4b53f576a7593204560f4ab2955f31eb07dcbfc282bef3532522a0448da
MD5 03f2e61e6c7b6651188799016a8da93c
BLAKE2b-256 02efc25e18b883f500aa6646a9ed489b452eade03a55ce668b84c4b9446eed06

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyqube-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 38.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 715cc173734bdecc6c00ef73f97e16643439f90d1929c91eac6685dcabd4cae2
MD5 de5c619a35de73bb17f1b8114c5ab580
BLAKE2b-256 b45d14887c156261f25d8a026a8001d2bbc858df69df8f72a3011167a13470b6

See more details on using hashes here.

Provenance

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