deltachat2


Namedeltachat2 JSON
Version 0.5.1 PyPI version JSON
download
home_pageNone
SummaryClient library for Delta Chat core JSON-RPC interface
upload_time2024-04-28 13:35:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
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/c8/81/b286578de3fc8a2d40bea537e81a3093c55d276a73797ca03a5879a80678/deltachat2-0.5.1.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.5.1",
    "project_urls": null,
    "split_keywords": [
        "deltachat"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "72e274fd981223f34dfe4a432b600101571746c82308a68178ced09a2acbdd26",
                "md5": "57ea9dd23063e3d0979afc5c9bb5e034",
                "sha256": "2dcf4a4fa34ce14ad08584459b19a51b5a67e7c834b9d5383415af3c4d84b48b"
            },
            "downloads": -1,
            "filename": "deltachat2-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "57ea9dd23063e3d0979afc5c9bb5e034",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19785,
            "upload_time": "2024-04-28T13:35:55",
            "upload_time_iso_8601": "2024-04-28T13:35:55.243807Z",
            "url": "https://files.pythonhosted.org/packages/72/e2/74fd981223f34dfe4a432b600101571746c82308a68178ced09a2acbdd26/deltachat2-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c881b286578de3fc8a2d40bea537e81a3093c55d276a73797ca03a5879a80678",
                "md5": "b7acc480d94ba23591ec8709317ca5a8",
                "sha256": "e60305895fb177ddc7713cdb8051667f5080ab19ddf50588fd4cadd07f9cffc0"
            },
            "downloads": -1,
            "filename": "deltachat2-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b7acc480d94ba23591ec8709317ca5a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 19595,
            "upload_time": "2024-04-28T13:35:56",
            "upload_time_iso_8601": "2024-04-28T13:35:56.898809Z",
            "url": "https://files.pythonhosted.org/packages/c8/81/b286578de3fc8a2d40bea537e81a3093c55d276a73797ca03a5879a80678/deltachat2-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 13:35:56",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "deltachat2"
}
        
Elapsed time: 0.26937s