skillfed

matrix-nio

A Python Matrix client library, designed according to sans I/O principles.

matrix-nio v0.26.0 943.8K downloads/30d#4,671 on PyPI705
License unclear Internet Systems Consortium license =================================== Copyright (c) `2018`, `Damir Jelić <poljar@termina.org.uk>` Permission to use, copy, modify, and/or distribute this software… (full text in the JSON record) Active released

What it is and what it does

matrix-nio is a multilayered Matrix protocol client library that separates the protocol logic (sans-IO base layer) from the network transport (asyncio/aiohttp layer). It handles the full lifecycle of Matrix client operations—authentication, room management, message synchronization, and user presence—with built-in support for end-to-end encryption when the optional libolm dependency is installed.

The library is designed for developers building bots, bridges, or interactive clients that need to connect to Matrix homeservers. It provides type hints throughout, supports custom authentication flows, and includes features like typing notifications, read receipts, message redaction, and emoji verification. File uploads and downloads are encrypted when E2EE is enabled. The package depends on aiohttp for HTTP, aiofiles for async file operations, h11 and h2 for HTTP protocol handling, jsonschema for validation, and pycryptodome for cryptographic operations.

Use it for:

  • Build a Matrix chat bot that listens to room messages and responds based on commands or triggers
  • Create a bridge between Matrix and another chat platform by syncing messages bidirectionally
  • Develop a custom Matrix client UI with end-to-end encryption support for secure messaging
  • Monitor Matrix rooms programmatically and log or alert on specific message patterns
  • Automate user registration and room management tasks on a Matrix homeserver

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

matrix-nio is an asyncio-based Python client library for the Matrix protocol, providing end-to-end encryption support, room management, and real-time synchronization with Matrix homeservers.

Yes. matrix-nio is actively maintained, has low install friction, no known vulnerabilities, and a permissive license. It is the standard choice for Python developers building Matrix clients or bots. Install without hesitation if you need Matrix protocol support; add the [e2e] extra only if you need end-to-end encryption and can install libolm on your system.

Install

matrix-nio on PyPI

pip

pip install matrix-nio

uv

uv add matrix-nio

poetry

poetry add matrix-nio

Installing matrix-nio

Before you install

Low friction install with a pure-Python wheel; active maintenance with a recent release 22 days ago. Optional E2EE support requires the libolm C library (version 3.x) installed separately via system package manager.

License in practice

Licensed under the Internet Systems Consortium license (ISC), a permissive open-source license similar to MIT. No notable restrictions for commercial or private use.

Quickstart

pip install matrix-nio

import asyncio
from nio import AsyncClient

async def main():
    client = AsyncClient("https://matrix.org", "@user:matrix.org")
    await client.login("password")
    await client.sync()
    await client.close()

asyncio.run(main())

Requires Python 3.10 or later. For end-to-end encryption, libolm C library (version 3.x) must be installed system-wide before installing matrix-nio[e2e].

Verify before relying

  • Whether cross-signing and server-side key backup features are planned or deprioritized
  • Performance characteristics under high message volume or large room counts
  • Compatibility with non-standard or older Matrix homeserver implementations

Package facts

License Internet Systems Consortium license =================================== Copyright (c) `2018`, `Damir Jelić <poljar@termina.org.uk>` Permission to use, copy, modify, and/or distribute this software… (full text in the JSON record) (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 8 — aiohttp, aiofiles, h11, h2, jsonschema, unpaddedbase64, pycryptodome, aiohttp-socks
Maintenance actively maintained — 22 days since the last release
Last repo commit
First released
Downloads 943,808/month — #4,671 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: matrix_nio-0.26.0-py3-none-any.whl

Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

matrix client library pythonmatrix protocol asyncioend-to-end encryption matrixmatrix chat client sdkmatrix homeserver pythonmatrix room managementmatrix live sync
matrix-protocolasync-ioe2e-encryption

More Internet packages