Skip to main content

Official LoopEngine SDK for sending feedback to the Ingest API

Project description

LoopEngine

Official LoopEngine SDK for sending feedback to the Ingest API. Two-line usage: create a client with your credentials, then call send with your payload.

  • No external dependencies — uses the Python standard library for HTTP and crypto
  • Small surface — one main client (LoopEngine) plus an async wrapper (AsyncLoopEngine)

Install

pip install loopengine

Usage (sync)

from loopengine import LoopEngine

client = LoopEngine(
    project_key="pk_live_...",
    project_secret="psk_live_...",
    project_id="proj_...",
)

result = client.send({"message": "User reported a bug"})
if result.ok:
    print(result.body)  # e.g. {"id": "fb_...", "analysis_status": "pending"}

Usage (async)

import asyncio
from loopengine import AsyncLoopEngine


async def main() -> None:
    client = AsyncLoopEngine(
        project_key="pk_live_...",
        project_secret="psk_live_...",
        project_id="proj_...",
    )
    result = await client.send({"message": "User reported a bug"})
    if result.ok:
        print(result.body)


if __name__ == "__main__":
    asyncio.run(main())

Config

Obtain project_key, project_secret, and project_id from your LoopEngine dashboard. A typical configuration pattern is to read them from environment variables:

import os
from loopengine import LoopEngine

client = LoopEngine(
    project_key=os.environ["LOOPENGINE_PROJECT_KEY"],
    project_secret=os.environ["LOOPENGINE_PROJECT_SECRET"],
    project_id=os.environ["LOOPENGINE_PROJECT_ID"],
)

Payload

The payload object you send must match the fields and constraints you defined when creating your project in the LoopEngine dashboard (required fields, allowed keys, value types, etc.). At a minimum, it should include all the required fields according to your project's schema.

You do not need to pass project_id in the payload; it is automatically injected from the client configuration.

Payloads can be:

  • A mapping/dict (dict[str, object])
  • Any JSON-serializable object (for example a dataclass) that encodes to a JSON object

Quick test with uv and clienttest

This repository includes a small clienttest example app you can run to verify your credentials and connectivity.

  1. Install uv (a fast Python package manager/runner):

    pip install uv
    # or: pipx install uv
    
  2. From the loopengine-python directory, run the example:

    # Using environment variables (recommended)
    export LOOPENGINE_PROJECT_KEY="pk_live_..."
    export LOOPENGINE_PROJECT_SECRET="psk_live_..."
    export LOOPENGINE_PROJECT_ID="proj_..."
    
    uv run examples/clienttest.py
    

    uv run creates an isolated environment, resolves dependencies, and executes the script in one step. Because this SDK has no runtime dependencies beyond the standard library, uv mainly provides a fast, reproducible way to run the example without managing a separate virtualenv.

  3. Alternatively, edit placeholders directly in examples/clienttest.py:

    project_key = "<your_project_key_here>"
    project_secret = "<your_project_secret_here>"
    project_id = "<your_project_id_here>"
    

    Then run:

    uv run examples/clienttest.py
    

Development

To run tests locally:

uv run pytest

Requirements

  • Python >= 3.9

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

loopengine-1.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

loopengine-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file loopengine-1.0.0.tar.gz.

File metadata

  • Download URL: loopengine-1.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for loopengine-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ca5e1932c695accf8fa5d8f9aeb88d36cb2653e6c065f654620b201672501f16
MD5 bea8237b6e4bfd430f8afbca8fe5e38b
BLAKE2b-256 0f5006a4990896b5c8c66ce8b58b08a4d8e259405d4324f82b15b97e0343ecd9

See more details on using hashes here.

File details

Details for the file loopengine-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: loopengine-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for loopengine-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d12f9ca526d94ab19da5f2c90c39a464d5f1e9ef926b146b232ddf463fc2d857
MD5 fceee18cc79921a110bd20c4bf8bf1f9
BLAKE2b-256 c3e4162e5599f3bc2c8fa10d7161d594cac137060b84c6a182f477c8da10908f

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