Skip to main content

Lightweight Python client for the Qualis Desk Roku machine API (connect, validate users, clear transactions).

Project description

qualis-roku

Python 3.9+ helper for automating Roku Developer Portal workflows when your organization exposes a compatible Qualis Desk–style HTTP API (portal sign-in, test-user validation, clearing channel transactions from CI or tooling).

Install

pip install qualis-roku

From source (development):

pip install -e "./packages/qualis_roku"

Use cases

  • Pre-flight checks — Confirm a QA email resolves to a portal test user for a given product (slug from your deployment) before a test run.
  • Clean slate — Void test-user purchases / entitlements on a channel before functional or billing-related tests.
  • Pipelines — Drive the same flows from Jenkins, GitHub Actions, or internal runners without opening the browser UI.
  • Batch operations — Loop over emails or products using the simple (success, message) API.

Design

  • connect() — Start (or queue) server-side portal sign-in; no required arguments if your deployment defines default apps via configuration.
  • validate(email, product) — Resolve the email in the current portal context for that product slug.
  • clear_txn(email, product) — Clear transactions for that email and product.

Each returns (True, message) or (False, message) so callers can branch without exceptions for normal failures.

Lower-level methods (validate_users, clear_transactions, connect_and_wait, …) return full JSON envelopes when you need structured details.

Quick start

Credentials and host can come from environment variables (recommended—nothing secret in code) or be passed explicitly to the constructor. Your internal runbook names the exact variables; typical names look like a “Qualis base URL” and an “API credential” for your deployment.

From environment (set vars in the shell, CI secrets, or .env loaded by your app—do not commit secrets). For connect() with no arguments, set QUALIS_ROKU_BRANDS (comma-separated product slugs from your deployment) or use connect_and_wait(brands=[...]) instead.

from qualis_roku import QualisRokuClient

# Uses deployment-specific env vars when base_url / api_token are omitted.
with QualisRokuClient() as client:
    ok, msg = client.connect()
    if not ok:
        raise SystemExit(msg)
    ok_v, msg_v = client.validate("user@example.com", "your-product-slug")
    if not ok_v:
        raise SystemExit(msg_v)
    ok_c, msg_c = client.clear_txn("user@example.com", "your-product-slug")
    if not ok_c:
        raise SystemExit(msg_c)

Explicit arguments (useful for tests or when config is not on the process environment):

with QualisRokuClient(
    base_url="https://your-qualis-host.example/qualis-desk",
    api_token="your-credential",
) as client:
    ok, msg = client.connect()
    ...

Omitted parameters fall back to environment; if both are missing, the client raises with a clear error. Passing base_url= or api_token= explicitly overrides the corresponding environment variable for that client instance.

Command line

After install, the qualis-roku executable (or python -m qualis_roku) exposes the same flows without writing Python:

qualis-roku --help
qualis-roku connect
qualis-roku validate user@example.com your-product-slug
qualis-roku clear user@example.com your-product-slug
qualis-roku run user@example.com your-product-slug

Pass --base-url and --api-token or configure the environment variables described in your internal runbook. No-arg connect (CLI or Python) needs QUALIS_ROKU_BRANDS (comma-separated product slugs) unless you use a code path that passes brands explicitly. connect can write a small session file (default ./.qualis_roku_session) so validate / clear can reuse the session; use --print-session-id-only for scripting.

Transient HTTP errors (429, 502–504) and retryable network failures are retried automatically with backoff.

Set QUALIS_ROKU_DEBUG=1 (or pass debug=True to QualisRokuClient) for verbose debug logs on stderr.

Requirements

  • Network: HTTPS access from the machine running the client to your Qualis deployment.
  • httpx (declared as a dependency).

Documentation

  • Full reference (operators + integrators): after install from source or a checkout, open docs/DOCUMENTATION.md — complete env var list, API surface, CLI flags, retries, debug logging, and troubleshooting.
  • Your organization may also maintain internal runbooks and HTTP samples for the server API; the PyPI page shows only this README.

Security (general)

  • Prefer TLS end-to-end.
  • Keep credentials out of source control and logs; use your platform’s secret management.

License

MIT.

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

qualis_roku-0.6.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

qualis_roku-0.6.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file qualis_roku-0.6.0.tar.gz.

File metadata

  • Download URL: qualis_roku-0.6.0.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for qualis_roku-0.6.0.tar.gz
Algorithm Hash digest
SHA256 141cd60b73e0e3b42800ab8af63a7e46b21b0161a8b5a444515739633a7c2085
MD5 026d20210a4d7c01a2b4869a72ab84d7
BLAKE2b-256 0a56daf25e5b325c06c4ec1da6dcb4e662395298b9ec7f4f50e181321ece62d8

See more details on using hashes here.

File details

Details for the file qualis_roku-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: qualis_roku-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for qualis_roku-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b57a18cab84ee1cc272bf604bfcbe4cdf86b27644373fdcfec617749c52ca35d
MD5 6853f9d7517a566da86763a7b1a40542
BLAKE2b-256 62df68f9f7da36ca8132741fc193f40d3f4adbfd2083c67bbc2017aba0da9aa6

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