Skip to main content

Lumina Core Python SDK

Project description

Lumina Python SDK

Production-grade Python SDK with:

  • Retry + exponential backoff
  • Batch sending (/api/v1/events/batch)
  • Offline disk queue (crash-safe)
  • Persistent device id
  • Error model (LuminaHTTPError, LuminaTransportError)
  • Event hooks (on("CRITICAL", ...))
  • Optional mouse auto-tracking (auto_track_mouse)

Structure

sdk/python/
  lumina_sdk/
    __init__.py
    client.py
    queue.py
    utils.py
  lumina_client.py  # backward-compatible shim

Quick Start

Install:

pip install lumina-core-sdk
from lumina_sdk import Lumina

lumina = Lumina(
    api_key="lumina_test",
    trader_id="TR_001",
    org_id="org_abc123",
    base_url="http://localhost:5000",
    flush_interval=2.0,
    max_batch=10,
)

lumina.on("CRITICAL", lambda payload: print("CRITICAL", payload))

lumina.track(
    {
        "type": "order_open",
        "reaction_time": 120,
        "rapid_reentry": True,
    }
)

state = lumina.get_state()
print(state)

lumina.shutdown(flush=True)

Optional Auto Tracking

# pip install pynput
lumina.auto_track_mouse(emit_interval_seconds=2.0)

Offline Persistence

By default SDK stores local data in:

  • ~/.lumina/device_id
  • ~/.lumina/events.queue.json
  • ~/.lumina/dead_letter.queue.json

Use storage_dir to change location.

Error Handling

from lumina_sdk import Lumina, LuminaHTTPError, LuminaTransportError

lumina = Lumina(api_key="lumina_test", trader_id="TR_001")

try:
    lumina.get_state()
except LuminaHTTPError as exc:
    print("HTTP", exc.status_code, exc.payload)
except LuminaTransportError as exc:
    print("Network", str(exc))

Notes

  • org_id is optional but recommended for org-scoped SDK keys.
  • When org_id is set, SDK sends x-org-id automatically.

Release Helpers

From repository root:

./sdk/release/bump-sdk-version.ps1 -Version 0.2.0
./sdk/release/run-sdk-release-checks.ps1 -SkipJavaScript

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

lumina_core_sdk-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

lumina_core_sdk-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file lumina_core_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: lumina_core_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for lumina_core_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8c1e5dffa4f53433fd1d62a438eb1d969af042d6f2706056edc55571eb43b7e
MD5 56b72b3bc62349ffde98f5914dfb7c18
BLAKE2b-256 24599618d589b05e3cdf7901e229800e9fb7fbbed16b3885046fe1566609b4bd

See more details on using hashes here.

File details

Details for the file lumina_core_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lumina_core_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8bf23d43715f33f13e3839b20cd85b551b674e762eff43dd8e89b712f92637e
MD5 67f476e4e8b7b535b0834c6a3db7db44
BLAKE2b-256 8d2c74873e5e0babaf09d9ebf4acd3ba07a13bb5514b056acb7c28229b1abc18

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