Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Matrix Client SDK for Python

Latest Version Travis-CI Results coveralls.io Results

This is a Matrix client-server SDK for Python 2.7 and 3.4+

Community discussion on usage of this SDK and development of this SDK can be found at #matrix-python-sdk:matrix.org.

Documentation can be found at http://matrix-org.github.io/matrix-python-sdk/

Installation

Stable release

Install with pip from pypi. This will install all necessary dependencies as well.

pip install matrix_client

Development version

Install using setup.py in root project directory. This will also install all needed dependencies.

git clone https://github.com/matrix-org/matrix-python-sdk.git
cd matrix-python-sdk
python setup.py install

E2E development

The Olm bindings are not yet hosted on PyPI. Hence it it necessary to pass --process-dependency-links when installing with pip, in order to fetch them from their Git repository. For example replace python setup.py install in the above instructions by pip install --process-dependency-links .[e2e].

Usage

The SDK provides 2 layers of interaction. The low-level layer just wraps the raw HTTP API calls. The high-level layer wraps the low-level layer and provides an object model to perform actions on.

Client:

from matrix_client.client import MatrixClient

client = MatrixClient("http://localhost:8008")

# New user
token = client.register_with_password(username="foobar", password="monkey")

# Existing user
token = client.login_with_password(username="foobar", password="monkey")

room = client.create_room("my_room_alias")
room.send_text("Hello!")

API:

from matrix_client.api import MatrixHttpApi

matrix = MatrixHttpApi("https://matrix.org", token="some_token")
response = matrix.send_message("!roomid:matrix.org", "Hello!")

Structure

The SDK is split into two modules: api and client.

API

This contains the raw HTTP API calls and has minimal business logic. You can set the access token (token) to use for requests as well as set a custom transaction ID (txn_id) which will be incremented for each request.

Client

This encapsulates the API module and provides object models such as Room.

Samples

A collection of samples are included, written in Python 3.

You can either install the SDK, or run the sample like this:

PYTHONPATH=. python samples/samplename.py

Building the Documentation

The documentation can be built by installing sphinx and sphinx_rtd_theme.

Simple run make inside docs which will list the avaliable output formats.

Metadata

Release files for matrix-client-harmonyqt 0.4.2.dev5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for matrix-client-harmonyqt 0.4.2.dev5
File Size Uploaded Provenance Actions
matrix_client_harmonyqt-0.4.2.dev5.tar.gz 84.9 kB Without provenance Details for matrix_client_harmonyqt-0.4.2.dev5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for matrix-client-harmonyqt 0.4.2.dev5
File Interpreter ABI Platform Actions
matrix_client_harmonyqt-0.4.2.dev5-py2.py3-none-any.whl Python 2, Python 3 none any Details for matrix_client_harmonyqt-0.4.2.dev5-py2.py3-none-any.whl

Total release size: 171.0 kB

Release files / matrix_client_harmonyqt-0.4.2.dev5.tar.gz

Download URL matrix_client_harmonyqt-0.4.2.dev5.tar.gz
Size 84.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a5707e131487838783c67b2c2c3463237572a59ddbd3fe8ede65682671ce62ed
BLAKE2b-256 checksum
How to use checksums
1c7bf3a199106c429f6e8c7716b18f8873c43c884f1f0e76c9a3500a094b421b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.8

Release files / matrix_client_harmonyqt-0.4.2.dev5-py2.py3-none-any.whl

Download URL matrix_client_harmonyqt-0.4.2.dev5-py2.py3-none-any.whl
Size 86.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4088e874fadbd90452195df22c52d1b31cc55aa6ca9664c98fd905832f54283c
BLAKE2b-256 checksum
How to use checksums
3de2d73d504f1a4f6ee8b6df3c58ed427d9eef7c2ab9ac6c8d4efc3b87d9580f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.8

Security for matrix-client-harmonyqt 0.4.2.dev5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page