Skip to main content

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

Project description

Matrix.py

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

Static Badge Join on Discord 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 .[env]

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

from matrix import Bot, Context

bot = Bot(username="@gracehopper:matrix.org", password="grace1234")


@bot.command("ping")
async def ping(ctx: Context):
    print(f"{ctx.sender} invoked {ctx.body} in room {ctx.room_name}.")
    await ctx.send("Pong!")


bot.start()

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 Discord community 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

matrix.py is released under GPL-3.0

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.2.0a0.tar.gz (78.7 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.2.0a0-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for matrix_python-1.2.0a0.tar.gz
Algorithm Hash digest
SHA256 4e39cf608c33f28b08e5d4705b3ab5fe1c26b1f877954e33f3e5c3fb061a9b72
MD5 c3a398be87222654ba0b717f00bff61e
BLAKE2b-256 91d0d5de8d8754859c5f48cb6d4c6ae17e7fea6c9cf4b7bf47f4fec45ecf3dfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrix_python-1.2.0a0.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.2.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for matrix_python-1.2.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad09c7357ced3bb2521c5b3f6de4779acbe6bb90b56f92cedc7a79a5a81a1963
MD5 0ed62b5bc6590e203ebc6509fad8e996
BLAKE2b-256 5491509021abdf548ae265021964fb9ac9e8bddab36fa044e6db558f096b4c48

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrix_python-1.2.0a0-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