Skip to main content

A toolset for Virtual Queue integrations in Python

Project description

Virtual Queue Python SDK

SDK to communicate with Virtual Queue's API in Python projects.

How to use

[!NOTE] See more examples here, including an example of how to use this SDK inside a Flask application

You can verify the token with TokenVerifier like this:

from vqueue import TokenVerifier
from vqueue.exceptions import VQueueApiError, VQueueError, VQueueNetworkError


def your_function_or_handler():
    # Get the token from the request in your system
    token = str(uuid4())  # This is an example UUIDv4

    # This handles the connections with a session and can be reused
    # for better performance
    verifier = TokenVerifier()

    try:
        # Handle the happy path
        verified_result = verifier.verify_token(token)
        print("The token was successfuly verified:", verified_result)
    except ValueError as ve:
        # Then handle the possible errors
        # Of course, you should handle the exceptions with more grace than this
        print("The token is not valir UUID", ve)
    except VQueueNetworkError as ne:
        print("Network error", ne)
    except VQueueApiError as ae:
        print("The API returned an error status", ae)
    except VQueueError as vqe:
        print("A generic error with the Virtual Queue system or this SDK", vqe)

You can also wrap your code in a context managed with block:

    with TokenVerifier() as verfifier:
        try:
            # Handle the happy path
            verified_result = verifier.verify_token(token)
            print("The token was successfuly verified:", verified_result)
        except ValueError as ve:
            # Then handle the possible errors
            # Of course, you should handle the exceptions with more grace than this
            print("The token is not valir UUID", ve)
        except VQueueNetworkError as ne:
            print("Network error", ne)
        except VQueueApiError as ae:
            print("The API returned an error status", ae)
        except VQueueError as vqe:
            print("A generic error with the Virtual Queue system or this SDK", vqe)

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

vqueue_sdk-0.1.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

vqueue_sdk-0.1.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vqueue_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.3

File hashes

Hashes for vqueue_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f20ac86e93d4c025b81d7f37225d3b85d652a7afd1e5f84ac80d3ca5d471c6a6
MD5 b23c335fcfd31a1d6170dac9d00db5cb
BLAKE2b-256 a2639760d52bb6b78f48d3aec022da2f6bb2255eea970a4e30654f831a4c71fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vqueue_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.3

File hashes

Hashes for vqueue_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31ffb6772bb4e1f8fdfc3e50332b2eec790029c507be6845a1a0446a60e00166
MD5 a30f18461d688fbc48ab5fe1fa205c88
BLAKE2b-256 d94c1872930e6042555e8ad0fe2d24eab88a5e13fa4b7ad137cc4c98bd25fab2

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