# Simple-Matrix-Bot-Lib
(Version 2.12.1)
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 Codeberg](https://codeberg.org/imbev/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 Codeberg.
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 Codeberg:
```
git clone --branch master https://codeberg.org/imbev/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": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "simple, matrix, bot, lib, simple-matrix-bot-lib",
"author": "imbev",
"author_email": "imbev@protonmail.com",
"download_url": "https://files.pythonhosted.org/packages/cc/90/1d38b24a0ade611d1031974c28e232530ca99b495f79e67ec1379cbc440b/simplematrixbotlib-2.12.1.tar.gz",
"platform": null,
"description": "# Simple-Matrix-Bot-Lib\n(Version 2.12.1)\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 Codeberg](https://codeberg.org/imbev/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 Codeberg.\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 Codeberg:\n\n```\ngit clone --branch master https://codeberg.org/imbev/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.12.1",
"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": "1a88bc090434107c7e97bddc414ed7e7fc8997e38d4342125b7f7da759041b4e",
"md5": "578d9ee56ec9bbddd4c04c2d1bfce486",
"sha256": "1a508056a291ae1bf23fc3f99aa41b656e3fa160da4244e03da29f36dc5d7a29"
},
"downloads": -1,
"filename": "simplematrixbotlib-2.12.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "578d9ee56ec9bbddd4c04c2d1bfce486",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 18039,
"upload_time": "2024-12-14T03:44:19",
"upload_time_iso_8601": "2024-12-14T03:44:19.246486Z",
"url": "https://files.pythonhosted.org/packages/1a/88/bc090434107c7e97bddc414ed7e7fc8997e38d4342125b7f7da759041b4e/simplematrixbotlib-2.12.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc901d38b24a0ade611d1031974c28e232530ca99b495f79e67ec1379cbc440b",
"md5": "86eafa8da542724c92a152240e915aec",
"sha256": "f5e30caf6a8cf1c94887790cc487da47a6dab4718cc2b34351e4a7e4ffc627be"
},
"downloads": -1,
"filename": "simplematrixbotlib-2.12.1.tar.gz",
"has_sig": false,
"md5_digest": "86eafa8da542724c92a152240e915aec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 15902,
"upload_time": "2024-12-14T03:44:21",
"upload_time_iso_8601": "2024-12-14T03:44:21.812437Z",
"url": "https://files.pythonhosted.org/packages/cc/90/1d38b24a0ade611d1031974c28e232530ca99b495f79e67ec1379cbc440b/simplematrixbotlib-2.12.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-14 03:44:21",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": true,
"codeberg_user": "imbev",
"codeberg_project": "simplematrixbotlib",
"lcname": "simplematrixbotlib"
}