Skip to content

Code-Society-Lab/matrixpy

Repository files navigation

matrix.py

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

Static Badge Join on Discord Tests

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 git+ssh://[email protected]:Code-Society-Lab/matrixpy.git

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

About

A simple, developer-friendly library for creating Matrix bots.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages