Skip to main content

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 trigger event models such as CronTrigger
  • hand-written request/response models exported from terse_sdk

Quick Start

from terse_sdk import CronTrigger, FinalOutput, Terse
from terse_generated import Schedule, TerseAgent

app = Terse()

@app.job(
    name="example-job",
    triggers=[Schedule.cron("0 9 * * 1")],
    skills=[],
)
def run_job(event: CronTrigger, agent: TerseAgent) -> None:
    prompt = (
        "Tell a joke"
        f"Context: {event.formatted_content}"
    )
    for stream_event in agent.run(prompt, event):
        if isinstance(stream_event, FinalOutput):
            print(stream_event.final_output)

Trigger and skill configs come from the generated helpers in terse_generated.py. Run terse init and terse generate to scaffold a project.

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 CronTrigger, Terse

app = Terse()

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

Local Development

To test local changes to the SDK in a Terse project, you need to add a uv source override so the resolver uses your local copy instead of PyPI.

From your project directory, run:

link-terse-py

This adds a [tool.uv.sources] entry to your pyproject.toml pointing at the local SDK and runs uv sync:

[tool.uv.sources]
terse-sdk = { path = "/path/to/Terse/packages/terse-python-sdk", editable = true }

To revert back to the published PyPI version:

unlink-terse-py

Why not uv pip install -e? uv manages dependencies declaratively from pyproject.toml + uv.lock. An imperative uv pip install -e gets overwritten the next time uv sync or uv run re-resolves from the lockfile. The source override tells uv's resolver itself to use the local path, so it persists across syncs.

Environment Variables

  • TERSE_API_KEY: required for agent runs and deterministic tool execution

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

Metadata

Release files for terse-sdk 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terse-sdk 0.1.11
File Size Uploaded
terse_sdk-0.1.11.tar.gz 51.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for terse-sdk 0.1.11
File Interpreter ABI Platform
terse_sdk-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size: 104.0 kB

Release files / terse_sdk-0.1.11.tar.gz

Download URL terse_sdk-0.1.11.tar.gz
Size 51.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f39503de2ce4c0b9d2615bdce69f63452acf420b6a89500c7aaf61beca070ec3
BLAKE2b-256 checksum
How to use checksums
86d839cd87ff18025ad69af31892cb3ae5f567c22dc639cc66f96daea9bd700d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / terse_sdk-0.1.11-py3-none-any.whl

Download URL terse_sdk-0.1.11-py3-none-any.whl
Size 52.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73070231696c0f5032f2c8b19bcee5043b21c04b60fc75fc737cfa83e65ce035
BLAKE2b-256 checksum
How to use checksums
4c34d8cc2ab86fa1e3e5e1f28c03915e79660a95c4f1b6205a9df82b53d9ba8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page