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'.

Release

Manual for now. Bump _version.py:__version__, build a wheel, upload to PyPI:

uv build --wheel
uv publish --token "$PYPI_TOKEN"

License

AGPL-3.0

Metadata

Release files for simplex-chat 7.1.0b6

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
File Size Uploaded Provenance Actions
simplex_chat-7.1.0b6.tar.gz 91.2 kB With provenance Details for simplex_chat-7.1.0b6.tar.gz

Built distribution (wheel)

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

Total release size: 168.5 kB

Release files / simplex_chat-7.1.0b6.tar.gz

Download URL simplex_chat-7.1.0b6.tar.gz
Size 91.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d3757fed9ea916613aa8ccfbcf142ecc8997fb9e8db5fb453796aa435646e5ab
BLAKE2b-256 checksum
How to use checksums
414257b92e780b5faebcde5e0766ed5f63d6b9b019187fffdc6aa761fc9a6c60
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 14, 2026.

Transparency log

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

Download URL simplex_chat-7.1.0b6-py3-none-any.whl
Size 77.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
249c1682849e942b13f1903a78c94f404a47e06f34314982f014523a25e5f4bb
BLAKE2b-256 checksum
How to use checksums
a4c967ff6f97973f75628512b9a5ec87a04d3766363f78f0906d2751d6125d2a
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 14, 2026.

Transparency log

Security for simplex-chat 7.1.0b6

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.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 14, 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