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.
- Minimal setup, easy to extend
- Event-driven API using async/await
- Clean command registration
- Automatic event handler registration
- Built on matrix-nio
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(config="config.yml")
@bot.command("ping")
async def ping(ctx: Context):
await ctx.send("Pong!")
bot.start()We welcome everyone to contribute!
Whether it's fixing bugs, suggesting features, or improving the docs - every bit helps.
If you intend to contribute, please read the CONTRIBUTING.md first. Additionally, every contributor is expected to follow the code of conduct.
matrix.py is released under GPL-3.0
