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.2.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.2-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqube-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5bd9ef07a7b0ea1ca71717b2329aaff2137caf2d064a92b48a79520c5888bf25
MD5 e184a4d5b296a61b20c4fbe882586fec
BLAKE2b-256 ed43cf8c3667984bdc2c673e174665aa7fe80f696ddac102341ed75be1cb41f1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyqube-0.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e319195c7d7973ae87e900b563fe213c762f78895007e60b5347b2af34eb9ccc
MD5 ab49965b5be63b054cca6f54d3dd5291
BLAKE2b-256 49460f02acb01c80bf0712e67857cf110301dd14669d5e4f7e77e3e43500ac9d

See more details on using hashes here.

Provenance

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