Skip to main content

chasky-botsmith-sdk — Python SDK

Delivery 3. Implemented; conformance runner in conformance/.

It arrives last, with the contract already shaken out by two implementations — which makes it the cheapest of the three, not the least important.

Shape

The guarantees are identical to the other two SDKs; the shape is Python's.

TypeScript Go Python
Concurrency AbortSignal context.Context asyncio
Terminal failure onFatal callback returned by Run raised
Handlers bot.on("text", fn) bot.Handle(fn) @bot.on_text
Entry point await bot.start() bot.Run(ctx) await bot.run()
Conformance a CLI go test unittest

There is no on_fatal: in Python an error that ends the loop is an exception, and callers already know how to handle one. Cancel the task to stop the bot.

bot = Bot(token=os.environ["CHASKY_BOT_TOKEN"])

@bot.command("start")
async def start(event: Event) -> None:
    await event.reply("Hello.")

@bot.on_text
async def echo(event: Event) -> None:
    await event.reply(f"You said: {event.message.text}")

await bot.run()

The one dependency

httpx, and it is not reached for lightly. Go and Node ship async HTTP in their standard library; Python does not. The alternative is urllib on a thread pool, and a 30-second long poll blocking a thread with poor cancellation is worse than one well-maintained dependency.

The conformance runner, by contrast, is stdlib only — its fake server is http.server on a thread — so checking the SDK installs nothing beyond httpx.

Running conformance

python -m venv .venv && .venv/bin/pip install -e . && .venv/bin/python -m unittest conformance.test_conformance -v

It reads the same cases as the other two SDKs, from ../conformance/cases.

test_runner_detects_a_mismatch keeps the runner honest: it takes a passing case, makes one expectation impossible, and requires the runner to notice. A runner that has never failed a case is not a tested runner.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chasky_botsmith_sdk-0.1.0.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

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

chasky_botsmith_sdk-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chasky_botsmith_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chasky_botsmith_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d4abd2f102c5ae333ad86ea784b369bf37e7ee0ee206e58fbbaea490fc7fbcd
MD5 ecc8ff8c27d59d33b5d55de1b85045db
BLAKE2b-256 36b209212efafa1ef14ef566a90ecb6ec11e56371326d3035cb9f5c1f5577176

See more details on using hashes here.

Provenance

The following attestation bundles were made for chasky_botsmith_sdk-0.1.0.tar.gz:

Publisher: publish.yml on chaskyapp/botsmith-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for chasky_botsmith_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 963d6f816f43aad7a6fabfc96d896bcac501326d192486b6b46bb8f2b2c430cb
MD5 d4826204138e1f716e00741470f53498
BLAKE2b-256 753d7d5abcbef954449401179d3c41d5b9595e4b3f8a6ee6e1d7e2ca2a63a34d

See more details on using hashes here.

Provenance

The following attestation bundles were made for chasky_botsmith_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on chaskyapp/botsmith-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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