Skip to main content

Client-Server SDK for Matrix

Project description

Matrix Client SDK for Python

.. image::
:alt: Latest Version
.. image::
:alt: Travis-CI Results
.. image::
:alt: 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 ``_.

.. _``:

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

.. code:: shell

pip install matrix_client

Development version
Install using ```` in root project directory. This will also install all
needed dependencies.

.. code:: shell

git clone
cd matrix-python-sdk
python install

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.


.. code:: python

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")


.. code:: python

from matrix_client.api import MatrixHttpApi

matrix = MatrixHttpApi("", token="some_token")
response = matrix.send_message("!", "Hello!")

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

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.

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

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

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

.. code:: shell

PYTHONPATH=. python samples/

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.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
matrix_client-0.2.0-py2.py3-none-any.whl (22.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 18, 2018
matrix_client-0.2.0.tar.gz (34.9 kB) Copy SHA256 hash SHA256 Source None Apr 18, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page