Name | deltachat2 JSON |
Version |
0.6.2
JSON |
| download |
home_page | None |
Summary | Client library for Delta Chat core JSON-RPC interface |
upload_time | 2024-05-21 11:19:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
deltachat
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Delta Chat client library for Python
[![Latest Release](https://img.shields.io/pypi/v/deltachat2.svg)](https://pypi.org/project/deltachat2)
[![CI](https://github.com/adbenitez/deltachat2/actions/workflows/python-ci.yml/badge.svg)](https://github.com/adbenitez/deltachat2/actions/workflows/python-ci.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Client library for Delta Chat core JSON-RPC interface
## Install
```sh
pip install deltachat2
```
To use this library, you need to have `deltachat-rpc-server` program installed,
you can install it together with this library with:
```sh
pip install deltachat2[full]
```
## Usage
Example echo-bot written with deltachat2:
```python
from deltachat2 import events, run_bot_cli
hooks = events.HookCollection()
@hooks.on(events.RawEvent)
def log_event(bot, accid, event):
bot.logger.info(event)
@hooks.on(events.NewMessage)
def echo(bot, accid, event):
msg = event.msg
bot.rpc.misc_send_text_message(accid, msg.chat_id, msg.text)
if __name__ == "__main__":
run_bot_cli(hooks)
```
Save the above code in a `echobot.py` file and run it with Python:
```
python echobot.py --email bot@example.com --password MyPassword
```
Then write to the bot address using your Delta Chat client to test it is working.
## Developing bots faster ⚡
If what you want is to develop bots, you probably should use this library together with
[deltabot-cli-py](https://github.com/deltachat-bot/deltabot-cli-py/), it takes away the
repetitive process of creating the bot CLI and let you focus on writing your message
processing logic.
Raw data
{
"_id": null,
"home_page": null,
"name": "deltachat2",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "deltachat",
"author": null,
"author_email": "adbenitez <adb@merlinux.eu>",
"download_url": "https://files.pythonhosted.org/packages/5e/3d/649e83759ce6ab72913a7688d6ab7a12c8f3041597daf95972e03a91e45f/deltachat2-0.6.2.tar.gz",
"platform": null,
"description": "# Delta Chat client library for Python\n\n[![Latest Release](https://img.shields.io/pypi/v/deltachat2.svg)](https://pypi.org/project/deltachat2)\n[![CI](https://github.com/adbenitez/deltachat2/actions/workflows/python-ci.yml/badge.svg)](https://github.com/adbenitez/deltachat2/actions/workflows/python-ci.yml)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nClient library for Delta Chat core JSON-RPC interface\n\n## Install\n\n```sh\npip install deltachat2\n```\n\nTo use this library, you need to have `deltachat-rpc-server` program installed,\nyou can install it together with this library with:\n\n```sh\npip install deltachat2[full]\n```\n\n## Usage\n\nExample echo-bot written with deltachat2:\n\n```python\nfrom deltachat2 import events, run_bot_cli\n\nhooks = events.HookCollection()\n\n@hooks.on(events.RawEvent)\ndef log_event(bot, accid, event):\n bot.logger.info(event)\n\n@hooks.on(events.NewMessage)\ndef echo(bot, accid, event):\n msg = event.msg\n bot.rpc.misc_send_text_message(accid, msg.chat_id, msg.text)\n\nif __name__ == \"__main__\":\n run_bot_cli(hooks)\n```\n\nSave the above code in a `echobot.py` file and run it with Python:\n\n```\npython echobot.py --email bot@example.com --password MyPassword\n```\n\nThen write to the bot address using your Delta Chat client to test it is working.\n\n## Developing bots faster \u26a1\n\nIf what you want is to develop bots, you probably should use this library together with\n[deltabot-cli-py](https://github.com/deltachat-bot/deltabot-cli-py/), it takes away the\nrepetitive process of creating the bot CLI and let you focus on writing your message\nprocessing logic.\n",
"bugtrack_url": null,
"license": null,
"summary": "Client library for Delta Chat core JSON-RPC interface",
"version": "0.6.2",
"project_urls": null,
"split_keywords": [
"deltachat"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e9c86eaa4dad074f92f46db874c1e972aed318f60d73d90b70f3fc577ff9571c",
"md5": "5a9ca7770c10f774e78b3d1a79c2b4a7",
"sha256": "88ae1dc7864676befc09bda5f42f01c00f0aba2e49c76055bbf0548b0faca135"
},
"downloads": -1,
"filename": "deltachat2-0.6.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5a9ca7770c10f774e78b3d1a79c2b4a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 19929,
"upload_time": "2024-05-21T11:19:01",
"upload_time_iso_8601": "2024-05-21T11:19:01.952151Z",
"url": "https://files.pythonhosted.org/packages/e9/c8/6eaa4dad074f92f46db874c1e972aed318f60d73d90b70f3fc577ff9571c/deltachat2-0.6.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5e3d649e83759ce6ab72913a7688d6ab7a12c8f3041597daf95972e03a91e45f",
"md5": "cdda9ac111bc9b7a4e90f6ec9e210366",
"sha256": "82cbc30684f5c673bf5786326a79c817831df9f21cb0ce665eeeb6f79655013a"
},
"downloads": -1,
"filename": "deltachat2-0.6.2.tar.gz",
"has_sig": false,
"md5_digest": "cdda9ac111bc9b7a4e90f6ec9e210366",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 19744,
"upload_time": "2024-05-21T11:19:03",
"upload_time_iso_8601": "2024-05-21T11:19:03.861189Z",
"url": "https://files.pythonhosted.org/packages/5e/3d/649e83759ce6ab72913a7688d6ab7a12c8f3041597daf95972e03a91e45f/deltachat2-0.6.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-21 11:19:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "deltachat2"
}