Skip to main content

An easy-to-use Matrix bot framework designed for quick development and minimal setup

Project description

A simple, developer-friendly library to create powerful Matrix bots.
image

Static Badge Join Discord Join Matrix Tests CodeQL Advanced OpenSSF Scorecard

Matrix.py is a lightweight and intuitive Python library to build bots on the Matrix protocol. It provides a clean, decorator-based API similar to popular event-driven frameworks, allowing developers to focus on behavior rather than boilerplate.

Key Features

  • Minimal setup, easy to extend
  • Event-driven API using async/await
  • Clean command registration
  • Automatic event handler registration
  • Built on matrix-nio

Quickstart

Requirements

  • Python 3.10+
pip install matrix-python

If you plan on contributing to matrix.py, we recommend to install the development libraries:

pip install -e .[dev]

Note: It is recommended to use a virtual environment when installing python packages.

from matrix import Bot, Context

bot = Bot()


@bot.command("ping")
async def ping(ctx: Context):
    await ctx.reply("Pong!")


bot.start(config="config.yml")

Documentation - Examples

Contributing

We welcome everyone to contribute!

Whether it's fixing bugs, suggesting features, or improving the docs - every bit helps.

  • Submit an issue
  • Open a pull request
  • Or just hop into our Matrix or Discord server and say hi!

If you intend to contribute, please read the CONTRIBUTING.md first. Additionally, every contributor is expected to follow the code of conduct.

License

This project is licensed under the terms of MIT license.

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

matrix_python-1.4.9a0.tar.gz (53.3 kB view details)

Uploaded Source

Built Distribution

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

matrix_python-1.4.9a0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file matrix_python-1.4.9a0.tar.gz.

File metadata

  • Download URL: matrix_python-1.4.9a0.tar.gz
  • Upload date:
  • Size: 53.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for matrix_python-1.4.9a0.tar.gz
Algorithm Hash digest
SHA256 436460c20d3ceeabc9e05b9961803edaadf9eeb379ae8a07c75a4f93b04582c8
MD5 2c4e28bf95eefc3acd113c328c555094
BLAKE2b-256 dca642b5817c038681e9084a4971d0fa7d71e23b9973d3b1b1d49edbedc5658f

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrix_python-1.4.9a0.tar.gz:

Publisher: publish.yml on Code-Society-Lab/matrixpy

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

File details

Details for the file matrix_python-1.4.9a0-py3-none-any.whl.

File metadata

  • Download URL: matrix_python-1.4.9a0-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for matrix_python-1.4.9a0-py3-none-any.whl
Algorithm Hash digest
SHA256 de4e5c2de5b1cb7a7fc2928b2a897108252c65caacd601d3f3d1149538696aab
MD5 deac2cf350d6a02f0cac40eb406269f3
BLAKE2b-256 02f9baf022fe28a221e0101a464d4a8503103a0c8e2274a42ef679bd76be1027

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrix_python-1.4.9a0-py3-none-any.whl:

Publisher: publish.yml on Code-Society-Lab/matrixpy

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

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