Matrix Client SDK for Python
============================
.. image:: https://img.shields.io/pypi/v/matrix-client.svg?maxAge=600
:target: https://pypi.python.org/pypi/matrix-client
:alt: Latest Version
.. image:: https://travis-ci.org/matrix-org/matrix-python-sdk.svg?branch=master
:target: https://travis-ci.org/matrix-org/matrix-python-sdk
:alt: Travis-CI Results
.. image:: https://coveralls.io/repos/github/matrix-org/matrix-python-sdk/badge.svg?branch=master
:target: https://coveralls.io/github/matrix-org/matrix-python-sdk?branch=master
:alt: coveralls.io Results
.. image:: https://img.shields.io/matrix/matrix-python-sdk:matrix.org
:target: https://matrix.to/#/%23matrix-python-sdk:matrix.org
:alt: Matrix chatroom
.. image:: https://img.shields.io/badge/docs-stable-blue
:target: https://matrix-org.github.io/matrix-python-sdk/
:alt: Documentation
Matrix client-server SDK for Python 2.7 and 3.4+
Project Status
--------------
We strongly recommend using the `matrix-nio`_ library rather than this
sdk. It is both more featureful and more actively maintained.
This sdk is currently lightly maintained without any person ultimately
responsible for the project. Pull-requests **may** be reviewed, but no
new-features or bug-fixes are being actively developed. For more info
or to volunteer to help, please see
https://github.com/matrix-org/matrix-python-sdk/issues/279 or come
chat in `#matrix-python-sdk:matrix.org`_.
.. _`matrix-nio`: https://github.com/poljar/matrix-nio
.. _`#matrix-python-sdk:matrix.org`: https://matrix.to/#/%23matrix-python-sdk:matrix.org
Installation
============
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 ``setup.py`` in root project directory. This will also install all
needed dependencies.
.. code:: shell
git clone https://github.com/matrix-org/matrix-python-sdk.git
cd matrix-python-sdk
python setup.py install
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:
.. 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(username="foobar", password="monkey")
room = client.create_room("my_room_alias")
room.send_text("Hello!")
API:
.. code:: python
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:
.. code:: shell
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/matrix-org/matrix-python-sdk",
"name": "matrix-client",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "chat sdk matrix matrix.org",
"author": "The Matrix.org Team",
"author_email": "team@matrix.org",
"download_url": "https://files.pythonhosted.org/packages/93/9a/23c4894da5aeb316903677c71014575c486616026b85e2d0b408f84d8540/matrix_client-0.4.0.tar.gz",
"platform": "",
"description": "Matrix Client SDK for Python\n============================\n\n.. image:: https://img.shields.io/pypi/v/matrix-client.svg?maxAge=600\n :target: https://pypi.python.org/pypi/matrix-client\n :alt: Latest Version\n.. image:: https://travis-ci.org/matrix-org/matrix-python-sdk.svg?branch=master\n :target: https://travis-ci.org/matrix-org/matrix-python-sdk\n :alt: Travis-CI Results\n.. image:: https://coveralls.io/repos/github/matrix-org/matrix-python-sdk/badge.svg?branch=master\n :target: https://coveralls.io/github/matrix-org/matrix-python-sdk?branch=master\n :alt: coveralls.io Results\n.. image:: https://img.shields.io/matrix/matrix-python-sdk:matrix.org\n :target: https://matrix.to/#/%23matrix-python-sdk:matrix.org\n :alt: Matrix chatroom\n.. image:: https://img.shields.io/badge/docs-stable-blue\n :target: https://matrix-org.github.io/matrix-python-sdk/\n :alt: Documentation\n\n\nMatrix client-server SDK for Python 2.7 and 3.4+\n\nProject Status\n--------------\n\nWe strongly recommend using the `matrix-nio`_ library rather than this\nsdk. It is both more featureful and more actively maintained.\n\nThis sdk is currently lightly maintained without any person ultimately\nresponsible for the project. Pull-requests **may** be reviewed, but no\nnew-features or bug-fixes are being actively developed. For more info\nor to volunteer to help, please see\nhttps://github.com/matrix-org/matrix-python-sdk/issues/279 or come\nchat in `#matrix-python-sdk:matrix.org`_.\n\n.. _`matrix-nio`: https://github.com/poljar/matrix-nio\n.. _`#matrix-python-sdk:matrix.org`: https://matrix.to/#/%23matrix-python-sdk:matrix.org\n\nInstallation\n============\nStable release\n--------------\nInstall with pip from pypi. This will install all necessary dependencies as well.\n\n.. code:: shell\n\n pip install matrix_client\n\nDevelopment version\n-------------------\nInstall using ``setup.py`` in root project directory. This will also install all\nneeded dependencies.\n\n.. code:: shell\n\n git clone https://github.com/matrix-org/matrix-python-sdk.git\n cd matrix-python-sdk\n python setup.py install\n\nUsage\n=====\nThe SDK provides 2 layers of interaction. The low-level layer just wraps the\nraw HTTP API calls. The high-level layer wraps the low-level layer and provides\nan object model to perform actions on.\n\nClient:\n\n.. code:: python\n\n from matrix_client.client import MatrixClient\n\n client = MatrixClient(\"http://localhost:8008\")\n\n # New user\n token = client.register_with_password(username=\"foobar\", password=\"monkey\")\n\n # Existing user\n token = client.login(username=\"foobar\", password=\"monkey\")\n\n room = client.create_room(\"my_room_alias\")\n room.send_text(\"Hello!\")\n\n\nAPI:\n\n.. code:: python\n\n from matrix_client.api import MatrixHttpApi\n\n matrix = MatrixHttpApi(\"https://matrix.org\", token=\"some_token\")\n response = matrix.send_message(\"!roomid:matrix.org\", \"Hello!\")\n\n\nStructure\n=========\nThe SDK is split into two modules: ``api`` and ``client``.\n\nAPI\n---\nThis contains the raw HTTP API calls and has minimal business logic. You can\nset the access token (``token``) to use for requests as well as set a custom\ntransaction ID (``txn_id``) which will be incremented for each request.\n\nClient\n------\nThis encapsulates the API module and provides object models such as ``Room``.\n\nSamples\n=======\nA collection of samples are included, written in Python 3.\n\nYou can either install the SDK, or run the sample like this:\n\n.. code:: shell\n\n PYTHONPATH=. python samples/samplename.py\n\nBuilding the Documentation\n==========================\n\nThe documentation can be built by installing ``sphinx`` and ``sphinx_rtd_theme``.\n\nSimple run ``make`` inside ``docs`` which will list the avaliable output formats.\n\n\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Client-Server SDK for Matrix",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/matrix-org/matrix-python-sdk"
},
"split_keywords": [
"chat",
"sdk",
"matrix",
"matrix.org"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6100f10d4b5d72c5afb9b703ea0cabbea1670cd20159afe1764f4322d00dec99",
"md5": "0a2371dc78da84d9f63c9abf3e787dbe",
"sha256": "20cb42fb644879858c3fdd348d1c349c33676f11d1597f820abfd0fc0e009cb1"
},
"downloads": -1,
"filename": "matrix_client-0.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "0a2371dc78da84d9f63c9abf3e787dbe",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 43535,
"upload_time": "2021-07-26T12:06:16",
"upload_time_iso_8601": "2021-07-26T12:06:16.401430Z",
"url": "https://files.pythonhosted.org/packages/61/00/f10d4b5d72c5afb9b703ea0cabbea1670cd20159afe1764f4322d00dec99/matrix_client-0.4.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "939a23c4894da5aeb316903677c71014575c486616026b85e2d0b408f84d8540",
"md5": "441c37175eeba25ad36632c1be1fa60a",
"sha256": "0678af40f2cb2f0928a908a410c029747d40cb961ac5a3f1bd05aa35563c3156"
},
"downloads": -1,
"filename": "matrix_client-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "441c37175eeba25ad36632c1be1fa60a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 48982,
"upload_time": "2021-07-26T12:06:18",
"upload_time_iso_8601": "2021-07-26T12:06:18.814178Z",
"url": "https://files.pythonhosted.org/packages/93/9a/23c4894da5aeb316903677c71014575c486616026b85e2d0b408f84d8540/matrix_client-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-07-26 12:06:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "matrix-org",
"github_project": "matrix-python-sdk",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "matrix-client"
}