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.
- Contract:
../docs/00-spec.md - Invariant vs idiomatic:
../docs/01-organization.md§3
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d4abd2f102c5ae333ad86ea784b369bf37e7ee0ee206e58fbbaea490fc7fbcd
|
|
| MD5 |
ecc8ff8c27d59d33b5d55de1b85045db
|
|
| BLAKE2b-256 |
36b209212efafa1ef14ef566a90ecb6ec11e56371326d3035cb9f5c1f5577176
|
Provenance
The following attestation bundles were made for chasky_botsmith_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on chaskyapp/botsmith-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chasky_botsmith_sdk-0.1.0.tar.gz -
Subject digest:
1d4abd2f102c5ae333ad86ea784b369bf37e7ee0ee206e58fbbaea490fc7fbcd - Sigstore transparency entry: 2799202339
- Sigstore integration time:
-
Permalink:
chaskyapp/botsmith-sdk@3200508ee3bb6ac8b60cc4eaeae108316fc78eab -
Branch / Tag:
refs/tags/python/v0.1.0 - Owner: https://github.com/chaskyapp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3200508ee3bb6ac8b60cc4eaeae108316fc78eab -
Trigger Event:
release
-
Statement type:
File details
Details for the file chasky_botsmith_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chasky_botsmith_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
963d6f816f43aad7a6fabfc96d896bcac501326d192486b6b46bb8f2b2c430cb
|
|
| MD5 |
d4826204138e1f716e00741470f53498
|
|
| BLAKE2b-256 |
753d7d5abcbef954449401179d3c41d5b9595e4b3f8a6ee6e1d7e2ca2a63a34d
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chasky_botsmith_sdk-0.1.0-py3-none-any.whl -
Subject digest:
963d6f816f43aad7a6fabfc96d896bcac501326d192486b6b46bb8f2b2c430cb - Sigstore transparency entry: 2799202403
- Sigstore integration time:
-
Permalink:
chaskyapp/botsmith-sdk@3200508ee3bb6ac8b60cc4eaeae108316fc78eab -
Branch / Tag:
refs/tags/python/v0.1.0 - Owner: https://github.com/chaskyapp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3200508ee3bb6ac8b60cc4eaeae108316fc78eab -
Trigger Event:
release
-
Statement type: