A Python 3 asyncio Matrix framework.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-05 23:42:16 +03:00
.github/workflows Update CI 2026-07-05 23:30:37 +03:00
docs Fix sqlalchemy version 2025-09-15 03:18:49 +03:00
mautrix BUmp version to 0.21.1 2026-07-05 23:30:59 +03:00
.editorconfig Don't trim whitespace in md files in editorconfig 2022-01-26 12:55:44 +02:00
.gitignore Update gitignore 2018-10-14 22:34:42 +03:00
.gitlab-ci.yml Fix CI image 2025-09-23 23:33:28 +03:00
.pre-commit-config.yaml Revert isort in pre-commit 2026-07-05 23:42:16 +03:00
CHANGELOG.md BUmp version to 0.21.1 2026-07-05 23:30:59 +03:00
dev-requirements.txt Revert isort in pre-commit 2026-07-05 23:42:16 +03:00
LICENSE LICENSE: remove trailing space and newline 2022-01-21 10:01:43 -07:00
MANIFEST.in Add changelog link to PyPI 2021-12-28 13:46:37 +02:00
optional-requirements.txt Add utilities for SSSS 2025-09-13 20:40:27 +03:00
pyproject.toml Update Black to 2024 style and Python 3.10 target 2024-01-29 18:48:49 +02:00
README.rst Update link to C-S spec 2025-08-13 22:14:11 +03:00
requirements.txt Remove typing_extensions usage 2022-02-20 14:01:21 +02:00
setup.py Update linters, CI and python version 2025-11-17 00:24:50 +02:00

mautrix-python
==============

|PyPI| |Python versions| |License| |Docs| |Code style| |Imports|

A Python 3.10+ asyncio Matrix framework.

Matrix room: `#maunium:maunium.net`_


Components
----------

* Basic HTTP request sender (mautrix.api_)

* `Client API`_ endpoints as functions (mautrix.client.api_)

* Medium-level application service framework (mautrix.appservice_)

  * Basic transaction and user/alias query support (based on Cadair's python-appservice-framework_)
  * Basic room state storage
  * Intent wrapper around the client API functions (design based on matrix-appservice-bridge)

* Medium-level end-to-end encryption framework (mautrix.crypto_)

  * Handles all the complicated e2ee key exchange
  * Uses libolm through python-olm for the low-level crypto

* High-level bridging utility framework (mautrix.bridge_)

  * Base class for bridges
  * Common bridge configuration and appservice registration generation things
  * Double-puppeting helper
  * End-to-bridge encryption helper

* High-level client framework (mautrix.client_)

  * Syncing and event handling helper.
  * End-to-end encryption helper.

* Utilities (mautrix.util_)

  * Matrix HTML parsing and generating utilities
  * Manhole system (get a python shell in a running process)
  * YAML config helpers
  * Database helpers (new: asyncpg, legacy: SQLAlchemy)
  * Color logging utility
  * Very simple HMAC-SHA256 utility for signing tokens (like JWT, but hardcoded to use a single good algorithm)

.. _#maunium:maunium.net: https://matrix.to/#/#maunium:maunium.net
.. _python-appservice-framework: https://github.com/Cadair/python-appservice-framework/
.. _Client API: https://spec.matrix.org/latest/client-server-api/

.. _mautrix.api: https://docs.mau.fi/python/latest/api/mautrix.api.html
.. _mautrix.client.api: https://docs.mau.fi/python/latest/api/mautrix.client.api.html
.. _mautrix.appservice: https://docs.mau.fi/python/latest/api/mautrix.appservice/index.html
.. _mautrix.bridge: https://docs.mau.fi/python/latest/api/mautrix.bridge/index.html
.. _mautrix.client: https://docs.mau.fi/python/latest/api/mautrix.client.html
.. _mautrix.crypto: https://docs.mau.fi/python/latest/api/mautrix.crypto.html
.. _mautrix.util: https://docs.mau.fi/python/latest/api/mautrix.util/index.html

.. |PyPI| image:: https://img.shields.io/pypi/v/mautrix.svg
   :target: https://pypi.python.org/pypi/mautrix
   :alt: PyPI: mautrix
.. |Python versions| image:: https://img.shields.io/pypi/pyversions/mautrix.svg
.. |License| image:: https://img.shields.io/github/license/mautrix/python.svg
   :target: https://github.com/mautrix/python/blob/master/LICENSE
   :alt: License: MPL-2.0
.. |Docs| image:: https://img.shields.io/gitlab/pipeline-status/mautrix/python?branch=master&gitlab_url=https%3A%2F%2Fmau.dev&label=docs
   :target: https://docs.mau.fi/python/latest/
.. |Code style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
.. |Imports| image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
   :target: https://pycqa.github.io/isort/