Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SimpleX Chat Python library

Python 3.11+ client for SimpleX Chat bots. Equivalent to the Node.js library.

Install

pip install simplex-chat

The native libsimplex is downloaded lazily on first use. To pre-fetch:

python -m simplex_chat install                     # sqlite (default)
python -m simplex_chat install --backend postgres  # linux-x86_64 only

Quick start

import re
from simplex_chat import Bot, BotProfile, Message, SqliteDb, TextMessage

bot = Bot(
    profile=BotProfile(display_name="Squaring bot"),
    db=SqliteDb(file_prefix="./squaring_bot"),
    welcome="Send me a number, I'll square it.",
)

@bot.on_message(content_type="text", text=re.compile(r"^-?\d+(\.\d+)?$"))
async def square(msg: TextMessage) -> None:
    n = float(msg.text or "0")
    await msg.reply(f"{n} * {n} = {n * n}")

@bot.on_message(content_type="text")
async def fallback(msg: Message) -> None:
    await msg.reply("Send me a number, like 7 or 3.14.")

if __name__ == "__main__":
    bot.run()

bot.run() blocks. The connection address is logged on startup — paste it into a SimpleX client to talk to the bot. Ctrl+C to stop.

Three decorators: @bot.on_message(...), @bot.on_command(name), @bot.on_event(tag). Message handlers are first-match-wins in registration order, so register specific filters first and catch-alls last.

See examples/squaring_bot.py for the full example.

Development

uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'
ruff check && pyright && pytest tests/

Wire types under src/simplex_chat/types/_*.py are generated. Regenerate with cabal test simplex-chat-test --test-options='--match Python'.

License

AGPL-3.0

Metadata

Release files for simplex-chat 7.1.0b6.post2

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

Source distribution (sdist)

Source distribution for simplex-chat 7.1.0b6.post2
File Size Uploaded Provenance Actions
simplex_chat-7.1.0b6.post2.tar.gz 91.9 kB With provenance Details for simplex_chat-7.1.0b6.post2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simplex-chat 7.1.0b6.post2
File Interpreter ABI Platform Actions
simplex_chat-7.1.0b6.post2-py3-none-any.whl Python 3 none any Details for simplex_chat-7.1.0b6.post2-py3-none-any.whl

Total release size: 170.1 kB

Release files / simplex_chat-7.1.0b6.post2.tar.gz

Download URL simplex_chat-7.1.0b6.post2.tar.gz
Size 91.9 kB
Tags Source
SHA-256 checksum
How to use checksums
680ad52f23027a2dc202721dee5dfe4736efd8011ebbb3736b00ac17ec879951
BLAKE2b-256 checksum
How to use checksums
1e1add52a51912d9e5bc3b8e48dea33ce14ad395c4086ffdc13a3560bc212f82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / simplex_chat-7.1.0b6.post2-py3-none-any.whl

Download URL simplex_chat-7.1.0b6.post2-py3-none-any.whl
Size 78.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37a0731f1b44e5cd536f9148ca4c5ab88f072111f8b5867d50c60296e1454c47
BLAKE2b-256 checksum
How to use checksums
e8c0e981fc8a1db5db22f78e56954fbe349b330cd5ff9d8450550917cb09d4ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for simplex-chat 7.1.0b6.post2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for simplex_chat-7.1.0b6.post2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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