asyncpusher


Nameasyncpusher JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryAn asynchronous Pusher client library
upload_time2023-08-07 12:24:00
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords aiohttp asynchronous pusher websocket
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # asyncpusher

asyncpusher is an asynchronous python client library for [Pusher](https://pusher.com/channels/)

## Features

- uses well-maintained [aiohttp](https://github.com/aio-libs/aiohttp)'s websocket library
- auto handles reconnection
- asynchronous
- supports Pusher Channels [protocol 7](https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol/)

## Install

```
$ python3 -m pip install asyncpusher
```

## Usage

```python
import asyncio
import logging
import sys

from asyncpusher.channel import Channel
from asyncpusher.pusher import Pusher

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)


async def handle_event(data):
    logging.info(f"{market} {data}")


async def main():
    loop = asyncio.get_running_loop()

    pusher = Pusher("<PUSHER_APP_KEY>", loop=loop)
    pusher.channels[channel_name] = channel
    await pusher.connect()
    channel_name = "<CHANNEL_NAME>"
    channel = await pusher.subscribe(channel_name)
    channel.bind("diff", handle_event, "usdt_tl")
    await asyncio.sleep(5)
    await pusher.unsubscribe(channel_name)
    await asyncio.sleep(5)
    await pusher.disconnect()


asyncio.run(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "asyncpusher",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "aiohttp,asynchronous,pusher,websocket",
    "author": "",
    "author_email": "Burak Yildiz <0byldz@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0c/9e/6bc151810b0b9ce913b74ee643e649e59f54e1e44fb1633d6089502afb11/asyncpusher-0.1.0.tar.gz",
    "platform": null,
    "description": "# asyncpusher\n\nasyncpusher is an asynchronous python client library for [Pusher](https://pusher.com/channels/)\n\n## Features\n\n- uses well-maintained [aiohttp](https://github.com/aio-libs/aiohttp)'s websocket library\n- auto handles reconnection\n- asynchronous\n- supports Pusher Channels [protocol 7](https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol/)\n\n## Install\n\n```\n$ python3 -m pip install asyncpusher\n```\n\n## Usage\n\n```python\nimport asyncio\nimport logging\nimport sys\n\nfrom asyncpusher.channel import Channel\nfrom asyncpusher.pusher import Pusher\n\nlogging.basicConfig(stream=sys.stdout, level=logging.DEBUG)\n\n\nasync def handle_event(data):\n    logging.info(f\"{market} {data}\")\n\n\nasync def main():\n    loop = asyncio.get_running_loop()\n\n    pusher = Pusher(\"<PUSHER_APP_KEY>\", loop=loop)\n    pusher.channels[channel_name] = channel\n    await pusher.connect()\n    channel_name = \"<CHANNEL_NAME>\"\n    channel = await pusher.subscribe(channel_name)\n    channel.bind(\"diff\", handle_event, \"usdt_tl\")\n    await asyncio.sleep(5)\n    await pusher.unsubscribe(channel_name)\n    await asyncio.sleep(5)\n    await pusher.disconnect()\n\n\nasyncio.run(main())\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An asynchronous Pusher client library",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/byildiz/asyncpusher#readme",
        "Issues": "https://github.com/byildiz/asyncpusher/issues",
        "Source": "https://github.com/byildiz/asyncpusher"
    },
    "split_keywords": [
        "aiohttp",
        "asynchronous",
        "pusher",
        "websocket"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b534ace0d4ddee2fb378909e6532a254edae92a1d412d9429572825c467264f",
                "md5": "ab11697c2e7af0039a238648bcfdb92e",
                "sha256": "b11edec80b3090d907deb9c214a2ba5851f72fd63972414eab4a689820e3d270"
            },
            "downloads": -1,
            "filename": "asyncpusher-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab11697c2e7af0039a238648bcfdb92e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 7279,
            "upload_time": "2023-08-07T12:23:58",
            "upload_time_iso_8601": "2023-08-07T12:23:58.776872Z",
            "url": "https://files.pythonhosted.org/packages/1b/53/4ace0d4ddee2fb378909e6532a254edae92a1d412d9429572825c467264f/asyncpusher-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c9e6bc151810b0b9ce913b74ee643e649e59f54e1e44fb1633d6089502afb11",
                "md5": "1734b6cf2d3d76a66d8a567a2e8985bb",
                "sha256": "4caab84101d710f08270e94173fabd926441767f00b22ce10e7636edd1a95ec4"
            },
            "downloads": -1,
            "filename": "asyncpusher-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1734b6cf2d3d76a66d8a567a2e8985bb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 28357,
            "upload_time": "2023-08-07T12:24:00",
            "upload_time_iso_8601": "2023-08-07T12:24:00.359461Z",
            "url": "https://files.pythonhosted.org/packages/0c/9e/6bc151810b0b9ce913b74ee643e649e59f54e1e44fb1633d6089502afb11/asyncpusher-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-07 12:24:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "byildiz",
    "github_project": "asyncpusher#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "asyncpusher"
}
        
Elapsed time: 1.80169s