An easy-to-use Matrix bot framework designed for quick development and minimal setup
Project description
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 — install and have a working bot running in minutes
- Event-driven — async/await API reacting to any Matrix room event
- Command system — decorator-based commands with automatic argument parsing
- Extensions — split your bot into modules as it grows
Quickstart
Requirements: Python 3.10+
pip install matrix-python
Using a virtual environment is strongly recommended:
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install matrix-python
Create a config.yml:
USERNAME: "@yourbot:matrix.org"
PASSWORD: "your_password"
from matrix import Bot, Context
bot = Bot()
@bot.command("ping")
async def ping(ctx: Context):
await ctx.reply("Pong!")
bot.start(config="config.yml")
Send !ping in any room the bot is in, it will reply Pong!.
Where to go next
- Guides — step-by-step tutorials covering commands, events, checks, extensions, and more
- Reference — complete API documentation for every class and function
- Examples — ready-to-run example bots demonstrating common patterns
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
- Hop into our Matrix or Discord and say hi!
Please read the CONTRIBUTING.md and follow the code of conduct.
License
Released under the MIT License.
Project details
Release history Release notifications | RSS feed
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 matrix_python-1.4.12a0.tar.gz.
File metadata
- Download URL: matrix_python-1.4.12a0.tar.gz
- Upload date:
- Size: 76.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dceb527e38616cac1d4389b323b2afd9ac5f227812b37d94aca586bb2fbcc79c
|
|
| MD5 |
363daa2ca00b4284bcbe26eb5e141264
|
|
| BLAKE2b-256 |
4b03b3d03447c5ef2bebf0affeabc5699ffd5045b79991134b6d2546808a8437
|
Provenance
The following attestation bundles were made for matrix_python-1.4.12a0.tar.gz:
Publisher:
publish.yml on Code-Society-Lab/matrixpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matrix_python-1.4.12a0.tar.gz -
Subject digest:
dceb527e38616cac1d4389b323b2afd9ac5f227812b37d94aca586bb2fbcc79c - Sigstore transparency entry: 1341121871
- Sigstore integration time:
-
Permalink:
Code-Society-Lab/matrixpy@f7df60d6da2b23c6eb19cb7e43b34c7ae396b511 -
Branch / Tag:
refs/tags/1.4.12-alpha - Owner: https://github.com/Code-Society-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7df60d6da2b23c6eb19cb7e43b34c7ae396b511 -
Trigger Event:
release
-
Statement type:
File details
Details for the file matrix_python-1.4.12a0-py3-none-any.whl.
File metadata
- Download URL: matrix_python-1.4.12a0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7172f4bd209bbd515c87ec72addb92b3ecc870372932e867e1517a700d17470b
|
|
| MD5 |
7620296e8951b88007c8cb74e229379f
|
|
| BLAKE2b-256 |
3567889b0765d49d17999d5003ab03b1b478677892d5676466d0c4d0b157f1e7
|
Provenance
The following attestation bundles were made for matrix_python-1.4.12a0-py3-none-any.whl:
Publisher:
publish.yml on Code-Society-Lab/matrixpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matrix_python-1.4.12a0-py3-none-any.whl -
Subject digest:
7172f4bd209bbd515c87ec72addb92b3ecc870372932e867e1517a700d17470b - Sigstore transparency entry: 1341122117
- Sigstore integration time:
-
Permalink:
Code-Society-Lab/matrixpy@f7df60d6da2b23c6eb19cb7e43b34c7ae396b511 -
Branch / Tag:
refs/tags/1.4.12-alpha - Owner: https://github.com/Code-Society-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7df60d6da2b23c6eb19cb7e43b34c7ae396b511 -
Trigger Event:
release
-
Statement type: