Skip to main content

Python SDK for Tesser Trading Engine

Project description

tesser-py

tesser-py is the Python SDK for building remote strategies that plug into the Tesser trading engine via gRPC.

Requirements

  • Python 3.9+
  • uv for dependency management (pip/venv also works, but all docs/tests assume uv)
  • protoc (v27+) available on PATH when regenerating protobuf stubs

Installation

Install the published package directly from PyPI (tesser) when writing strategies outside of this monorepo:

pip install tesser
# or with uv
uv pip install tesser

For local development against the repo sources (needed when touching protobufs or contributing to the SDK), stay inside sdk/tesser-py and sync dependencies via uv:

cd sdk/tesser-py
uv sync --all-extras

Quick Start

Generate protobuf stubs, run tests, and then start iterating on strategies:

cd sdk/tesser-py
uv sync --all-extras
uv run scripts/codegen.py
uv run pytest

Then start a strategy:

import asyncio
from tesser import Runner, Strategy, Signal, SignalKind

class PyCross(Strategy):
    def __init__(self):
        super().__init__(name="py-cross", symbol="BTC-USD")

    async def on_tick(self, context, tick):
        if tick.price > 50_000:
            return [Signal(symbol=tick.symbol, kind=SignalKind.ENTER_LONG)]
        return []

if __name__ == "__main__":
    asyncio.run(Runner(PyCross()).serve())

Layout

sdk/tesser-py/
├── pyproject.toml
├── src/tesser/        # Library sources
├── scripts/codegen.py # Protobuf generator
├── tests/             # Unit/integration tests
└── examples/

Code Generation

uv run scripts/codegen.py compiles the protobuf definition located under tesser-rpc/proto and drops the generated files in src/tesser/protos. This step runs automatically in CI and should be executed whenever the proto changes.

Version Sync

The Python package version is derived from the workspace Cargo.toml. Run uv run scripts/sync_version.py whenever the Rust version changes to keep the SDK aligned with the rest of the monorepo.

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

tesser-0.8.0.tar.gz (89.4 kB view details)

Uploaded Source

Built Distribution

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

tesser-0.8.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file tesser-0.8.0.tar.gz.

File metadata

  • Download URL: tesser-0.8.0.tar.gz
  • Upload date:
  • Size: 89.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tesser-0.8.0.tar.gz
Algorithm Hash digest
SHA256 ec4fe0d472aeb59bf719b2b8f5fae6c6ca07f4b579246914af1e8157ea8f533b
MD5 cf2c89e26792b81340250cf7b8d732cf
BLAKE2b-256 c9346d19df8381e27a0f41f8ff4e63045e07d38f7d7a13f3e9cc7c08a4e162cb

See more details on using hashes here.

File details

Details for the file tesser-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: tesser-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tesser-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f10b4ca0b48ee67f445437155dd81a82e347f6222ee3e46cc209ceb08d887cec
MD5 6871e38668464014b1791919bb450b5f
BLAKE2b-256 f14a19a3e8963a2fb63cc281c5ae4239915c0a69e3c21f07e96e345dd65daf44

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