Skip to main content

Python SDK for building jobs on the Terse platform.

Project description

terse-sdk

Python SDK for building jobs on the Terse platform.

Most users should start with terse-cli, which scaffolds a project and generates terse_generated.py helpers for the currently supported trigger and skill surface.

Installation

python -m pip install terse-sdk

Runtime API

The SDK provides:

  • Terse for runtime job registration
  • @app.job(...) for declaring jobs
  • TerseAgent for agent runs and deterministic tool execution
  • typed event models such as CronJobInputEvent
  • hand-written request/response models exported from terse_sdk

Quick Start

from terse_sdk import CronJobInputEvent, EventType, Terse, TerseAgent

app = Terse()

@app.job(
    name="example-job",
    triggers=[],
    skills=[],
)
def example(event: CronJobInputEvent, agent: TerseAgent) -> None:
    for stream_event in agent.run(
        "Answer with one short, cute sentence about this cron job.",
        event,
    ):
        if stream_event.type == EventType.FINAL_OUTPUT:
            print(stream_event.finalOutput)

example(
    CronJobInputEvent(
        event_type="manual",
        formatted_content="Manual local run",
        debug_log="README example",
    ),
    TerseAgent(),
)

That example is intentionally self-contained. In a real Terse project, trigger and skill configs normally come from the generated helpers in terse_generated.py, not from manually constructing low-level DTOs.

Generated Helpers

The SDK package does not generate project helpers by itself.

If you scaffold a project with terse init and then run terse generate, your project gets src/terse_generated.py with the currently supported helpers:

  • Schedule.cron(...)
  • Attio.skill(...)
  • Snowflake.skill(...)
  • deterministic wrappers on agent.tools.attio and agent.tools.snowflake

Example inside a generated project:

from terse_generated import Schedule, Snowflake, TerseAgent
from terse_sdk import CronJobInputEvent, Terse

app = Terse()

@app.job(
    name="snowflake-job",
    triggers=[Schedule.cron("0 9 * * 1")],
    skills=[Snowflake.skill()],
)
def example(event: CronJobInputEvent, agent: TerseAgent) -> None:
    result = agent.tools.snowflake.execute_query(query="select current_date()")
    print(result)

Environment Variables

  • TERSE_API_KEY: required for agent runs and deterministic tool execution
  • TERSE_BACKEND_URL: optional backend override for local development
  • TERSE_FRONTEND_URL: optional frontend override for local development

Recommended Path

If you want the full project workflow, install the CLI instead:

python -m pip install terse-cli
terse init my-terse-job

Source

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

terse_sdk-0.1.3.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

terse_sdk-0.1.3-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file terse_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: terse_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for terse_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d528cd5b5e441a748af34e52ed5b3de0b8f5666a86e36204c0d3dfd53631b271
MD5 e40e50b1345c93f99b120a8c308f72fe
BLAKE2b-256 835a1eb3cb7f7eeb012a1db2b20bd6270feef9f7598c0baabfe776aae2a4a189

See more details on using hashes here.

File details

Details for the file terse_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: terse_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for terse_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 87e0156761e4084081e2e2bdcfe8d958ea1d5d2a18b32cb84948efd9741ecc7c
MD5 ccada24bc4ec9100c55d6a4dc8899d45
BLAKE2b-256 d95f54be114b565824b29b1a66090afe20b001b3da1b97652d5c5ed8faabbc89

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