Matrix ASGI
with matrix-nio
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
Metadata
Release files for matrix-asgi 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| matrix_asgi-2.0.0.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| matrix_asgi-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / matrix_asgi-2.0.0.tar.gz
| Download URL | matrix_asgi-2.0.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22b5618d59f6d699304d6df91ae6d57076ec3c9b747b5d26e05b55ee5a73bb2e
|
|
BLAKE2b-256 checksum How to use checksums |
c52886e704aa25ee3cae1556155345737b2f0b5a0df17d5c2bec3b6a71d06800
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / matrix_asgi-2.0.0-py3-none-any.whl
| Download URL | matrix_asgi-2.0.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03b492217569d6bcabd04b0a85edf618d4927380a6f17a350c25bbfba8a38a5f
|
|
BLAKE2b-256 checksum How to use checksums |
f55ca6c9dd3e5aefa0b806a79fcced304c9a9a2d190e50ddbe2b4fd1107d048d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|