The `matrix-client` library is a Client-Server SDK for the Matrix protocol, providing functionality to interact with Matrix homeservers. It is currently at version 0.4.0 and releases are infrequent, often addressing breaking changes or incompatibilities with the Matrix protocol or Synapse homeserver.
pip install matrix-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to log into a Matrix homeserver, join a room, send a message, and then log out. Ensure `MATRIX_HOMESERVER_URL`, `MATRIX_USERNAME`, `MATRIX_PASSWORD`, and `MATRIX_ROOM` environment variables are set or replaced with actual values.
Upgrade to `matrix-client` v0.4.0 or newer. When initializing `MatrixClient`, it's recommended to set `use_authorization_header=True` for better compatibility with modern Synapse versions.
First, install `libolm` (version 3.0.0 or higher) system-wide on your operating system. Then, install the Python E2E dependencies using `pip install matrix-client[e2e]`.
Refer to the latest documentation for preferred ways to access and modify properties (e.g., `room.name` instead of `room.get_name()`), avoiding deprecated methods.
Ensure your code uses the `/sync` API calls via the client's methods, rather than making direct calls to the deprecated endpoints, which may no longer be supported by homeservers.
Upgrade to `matrix-client` v0.4.0 and initialize `MatrixClient(homeserver_url, use_authorization_header=True)`. Double-check your username and password.
First, install `libolm` (version 3.0.0 or higher) system-wide on your operating system. Then, install the Python E2E dependencies: `pip install matrix-client[e2e]`.
Access the attribute directly (e.g., `room.name`) instead of using `room.get_name()`. Consult the library's documentation for current API methods.