simplematrixbotlib


Namesimplematrixbotlib JSON
Version 2.11.0 PyPI version JSON
download
home_pagehttps://codeberg.org/imbev/simplematrixbotlib
SummaryAn easy to use bot library for the Matrix ecosystem written in Python.
upload_time2024-02-20 22:53:54
maintainer
docs_urlNone
authorimbev
requires_python>=3.8,<4.0
licenseMIT
keywords simple matrix bot lib simple-matrix-bot-lib
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple-Matrix-Bot-Lib
(Version 2.11.0)

Simple-Matrix-Bot-Lib is a Python bot library for the Matrix ecosystem built on [matrix-nio](https://github.com/poljar/matrix-nio).

[View on Github](https://github.com/i10b/simplematrixbotlib) or [View on PyPi](https://pypi.org/project/simplematrixbotlib/) or
[View docs on readthedocs.io](https://simple-matrix-bot-lib.readthedocs.io/en/latest/)

Learn how you can contribute [here](CONTRIBUTING.md).

## Features

- [x] hands-off approach: get started with just 10 lines of code (see [example](#Example-Usage))
- [x] [end-to-end encryption support](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#e2e-encryption)
- [x] limited [verification support](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#verification) (device only)
- [x] easily [extensible config file](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#extending-the-config-class-with-custom-settings)
- [x] [user access management](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#allowlist)
- [x] access the matrix-nio library to use advanced features

## Installation

### simplematrixbotlib can be either installed from PyPi or downloaded from github.

Installation from PyPi:

```
python -m pip install simplematrixbotlib
```

[Read the docs](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#e2e-encryption) to learn how to install E2E encryption support.

Download from github:

```
git clone --branch master https://github.com/i10b/simplematrixbotlib.git
```



## Example Usage

```python
# echo.py
# Example:
# randomuser - "!echo example string"
# echo_bot - "example string"

import simplematrixbotlib as botlib

creds = botlib.Creds("https://home.server", "echo_bot", "pass")
bot = botlib.Bot(creds)
PREFIX = '!'

@bot.listener.on_message_event
async def echo(room, message):
    match = botlib.MessageMatch(room, message, bot, PREFIX)

    if match.is_not_from_this_bot() and match.prefix() and match.command("echo"):

        await bot.api.send_text_message(
            room.room_id, " ".join(arg for arg in match.args())
            )

bot.run()
```

More information and examples can be found [here](https://simple-matrix-bot-lib.readthedocs.io/en/latest/).

            

Raw data

            {
    "_id": null,
    "home_page": "https://codeberg.org/imbev/simplematrixbotlib",
    "name": "simplematrixbotlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "simple,matrix,bot,lib,simple-matrix-bot-lib",
    "author": "imbev",
    "author_email": "imbev@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2e/9c/745909112f035a4371477fd8eb75808f368b479464d1b928ad5fe3ad2416/simplematrixbotlib-2.11.0.tar.gz",
    "platform": null,
    "description": "# Simple-Matrix-Bot-Lib\n(Version 2.11.0)\n\nSimple-Matrix-Bot-Lib is a Python bot library for the Matrix ecosystem built on [matrix-nio](https://github.com/poljar/matrix-nio).\n\n[View on Github](https://github.com/i10b/simplematrixbotlib) or [View on PyPi](https://pypi.org/project/simplematrixbotlib/) or\n[View docs on readthedocs.io](https://simple-matrix-bot-lib.readthedocs.io/en/latest/)\n\nLearn how you can contribute [here](CONTRIBUTING.md).\n\n## Features\n\n- [x] hands-off approach: get started with just 10 lines of code (see [example](#Example-Usage))\n- [x] [end-to-end encryption support](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#e2e-encryption)\n- [x] limited [verification support](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#verification) (device only)\n- [x] easily [extensible config file](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#extending-the-config-class-with-custom-settings)\n- [x] [user access management](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#allowlist)\n- [x] access the matrix-nio library to use advanced features\n\n## Installation\n\n### simplematrixbotlib can be either installed from PyPi or downloaded from github.\n\nInstallation from PyPi:\n\n```\npython -m pip install simplematrixbotlib\n```\n\n[Read the docs](https://simple-matrix-bot-lib.readthedocs.io/en/latest/manual.html#e2e-encryption) to learn how to install E2E encryption support.\n\nDownload from github:\n\n```\ngit clone --branch master https://github.com/i10b/simplematrixbotlib.git\n```\n\n\n\n## Example Usage\n\n```python\n# echo.py\n# Example:\n# randomuser - \"!echo example string\"\n# echo_bot - \"example string\"\n\nimport simplematrixbotlib as botlib\n\ncreds = botlib.Creds(\"https://home.server\", \"echo_bot\", \"pass\")\nbot = botlib.Bot(creds)\nPREFIX = '!'\n\n@bot.listener.on_message_event\nasync def echo(room, message):\n    match = botlib.MessageMatch(room, message, bot, PREFIX)\n\n    if match.is_not_from_this_bot() and match.prefix() and match.command(\"echo\"):\n\n        await bot.api.send_text_message(\n            room.room_id, \" \".join(arg for arg in match.args())\n            )\n\nbot.run()\n```\n\nMore information and examples can be found [here](https://simple-matrix-bot-lib.readthedocs.io/en/latest/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An easy to use bot library for the Matrix ecosystem written in Python.",
    "version": "2.11.0",
    "project_urls": {
        "Documentation": "https://simple-matrix-bot-lib.readthedocs.io/en/latest/",
        "Homepage": "https://codeberg.org/imbev/simplematrixbotlib",
        "Matrix Room": "https://matrix.to/#/#simplematrixbotlib:matrix.org",
        "Repository": "https://codeberg.org/imbev/simplematrixbotlib"
    },
    "split_keywords": [
        "simple",
        "matrix",
        "bot",
        "lib",
        "simple-matrix-bot-lib"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "693b7ea564940b9b7fd0996fdb793d57bec4cd72aac80170b5cc67aa9e44cd98",
                "md5": "425aec29f1ec2ab27c9d2f125f52ae22",
                "sha256": "a12dfa91ff11372c568806b2e8ec540bc7f9112e379cf7270a9043877ea5322d"
            },
            "downloads": -1,
            "filename": "simplematrixbotlib-2.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "425aec29f1ec2ab27c9d2f125f52ae22",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 16310,
            "upload_time": "2024-02-20T22:53:52",
            "upload_time_iso_8601": "2024-02-20T22:53:52.666096Z",
            "url": "https://files.pythonhosted.org/packages/69/3b/7ea564940b9b7fd0996fdb793d57bec4cd72aac80170b5cc67aa9e44cd98/simplematrixbotlib-2.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2e9c745909112f035a4371477fd8eb75808f368b479464d1b928ad5fe3ad2416",
                "md5": "f29d53cb3da9b6b22999270ea4e5b055",
                "sha256": "f620d95889ea5db6f8e6d31f672b00187969e65290cd0c2777b4fc69e023001c"
            },
            "downloads": -1,
            "filename": "simplematrixbotlib-2.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f29d53cb3da9b6b22999270ea4e5b055",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 14275,
            "upload_time": "2024-02-20T22:53:54",
            "upload_time_iso_8601": "2024-02-20T22:53:54.449852Z",
            "url": "https://files.pythonhosted.org/packages/2e/9c/745909112f035a4371477fd8eb75808f368b479464d1b928ad5fe3ad2416/simplematrixbotlib-2.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 22:53:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": true,
    "codeberg_user": "imbev",
    "codeberg_project": "simplematrixbotlib",
    "lcname": "simplematrixbotlib"
}
        
Elapsed time: 0.18123s