Registry / http-networking / mautrix

mautrix

JSON →
library0.21.0pypypi✓ verified 89d ago

A Python 3 asyncio Matrix framework for building Matrix clients and application services. Current version 0.21.0 supports Python 3.10+. The bridge module is deprecated in favor of Go rewrites. Release cadence is irregular, roughly quarterly.

pip install mautrix
INSTALL
IMPORT
SIG · MAUTRIX
M
mautrix
http-networkingpythonv0.21.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
✓ from mautrix.client import Client
AppService
✓ from mautrix.appservice import AppService
OlmMachine
✓ from mautrix.crypto import OlmMachine
RoomCreateEventContent
✓ from mautrix.types import RoomCreateEventContent

Basic Matrix client syncing rooms

import asyncio from mautrix.client import Client async def main(): client = Client("https://matrix.example.com") # Replace with actual access token client.access_token = "your_token_here" resp = await client.sync() print(resp.rooms) asyncio.run(main())
Debug
Known issues
deprecatedThe `bridge` module is deprecated. All bridges are being rewritten in Go. See https://mau.fi/blog/2024-h1-mautrix-updates/
fix
Migrate to Go-based bridges or use the client module directly.
affects: >=0.20.5
breakingThe `state_store` SQLAlchemy implementations were removed in v0.20.0.
fix
Use the built-in file-based state store or implement your own.
affects: >=0.20.0
breakingSQLite database URI format changed: `sqlite:///path.db` no longer works for relative paths. Use `sqlite:path.db` for relative, `sqlite:/path.db` for absolute.
fix
Update your database URI accordingly.
affects: >=0.20.0
gotchaPython 3.9 support was dropped in v0.20.4. Use Python >=3.10.
fix
Upgrade Python to 3.10 or later.
affects: >=0.20.4
Errors
Common errors & fixes
ImportError: cannot import name 'Client' from 'mautrix' (unknown location)
Incorrect import path; Client is in the 'client' submodule.
fix
Use `from mautrix.client import Client`
ModuleNotFoundError: No module named 'mautrix.crypto'
Missing optional dependencies; crypto requires libolm.
fix
Install with `pip install mautrix[crypto]`
TypeError: __init__() missing 1 required positional argument: 'base_url'
Client constructor requires base_url argument.
fix
Initialize with `Client('https://matrix.example.com')`
mautrix.errors.MatrixError: M_UNKNOWN_TOKEN
Invalid or expired access token.
fix
Set a valid access token: `client.access_token = '...'`
Upgrade
Version history
0.21.0latest on PyPI · released Nov 17, 2025
Audit
Dependencies
aiohttprequiredHTTP client for Matrix API
attrsrequiredData classes for event types
yarlrequiredURL handling
Agent activity
25 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources
mautrix — pip install mautrix · libregistry