Skip to main content

ASGI Server for the Matrix protocol

Project description

Matrix ASGI

Tests Lints Release pre-commit.ci status

Code style: black codecov Maintainability PyPI version

with matrix-nio

#matrix-asgi:laas.fr

Install

python3 -m pip install matrix-asgi

Use it in your app

You can look at the models.py and consumers.py files in the test application for a simple and quick example.

Start

Create a matrix user for the bot, and launch this server with the following arguments and/or environment variables (environment variables update defaults, arguments take precedence):

matrix-asgi
# OR
python -m matrix_asgi
usage: matrix-asgi [-h] [-u MATRIX_URL] -i MATRIX_ID -p MATRIX_PW [-v] application

Matrix ASGI Server.

positional arguments:
  application           The ASGI application instance to use as path.to.module:application

options:
  -h, --help            show this help message and exit
  -u MATRIX_URL, --matrix-url MATRIX_URL
                        matrix homeserver url. Default: `https://matrix.org`.
                        Environment variable: `MATRIX_URL`
  -i MATRIX_ID, --matrix-id MATRIX_ID
                        matrix user-id. Required.
                        Environment variable: `MATRIX_ID`
  -p MATRIX_PW, --matrix-pw MATRIX_PW
                        matrix password. Required.
                        Environment variable: `MATRIX_PW`
  -v, --verbose         increment verbosity level

Unit tests

docker compose -f test.yml up --exit-code-from tests --force-recreate --build

JSON Specification

ref. spec.md

Changes

ref. CHANGELOG.md

Project details


Download files

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

Source Distribution

matrix_asgi-2.0.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

matrix_asgi-2.0.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page