aiofcm


Nameaiofcm JSON
Version 1.4 PyPI version JSON
download
home_pagehttps://github.com/Fatal1ty/aiofcm
SummaryAn efficient Firebase Cloud Messaging Client Library for Python/asyncio
upload_time2023-03-14 09:39:52
maintainer
docs_urlNone
authorAlexander Tikhonov
requires_python
licenseApache License, Version 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            aiofcm - An efficient Firebase Cloud Messaging Client Library for Python/asyncio
=================================================================================

.. image:: https://travis-ci.org/Fatal1ty/aiofcm.svg?branch=master
    :target: https://travis-ci.org/Fatal1ty/aiofcm

.. image:: https://img.shields.io/pypi/v/aiofcm.svg
    :target: https://pypi.python.org/pypi/aiofcm

.. image:: https://img.shields.io/pypi/pyversions/aiofcm.svg
    :target: https://pypi.python.org/pypi/aiofcm/

.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
    :target: https://opensource.org/licenses/Apache-2.0

**aiofcm** is a library designed specifically for sending messages such as push-notifications
to Android devices via Firebase Cloud Messaging platform. aiofcm provides an efficient client
through asynchronous XMPP protocol for use with Python's ``asyncio``
framework.

aiofcm requires Python 3.5 or later.


Performance
-----------

In my testing aiofcm allows you to send on average 1k messages per second on a single core.


Features
--------

* Internal connection pool which adapts to the current load
* Sending notification and/or data messages
* Ability to set TTL (time to live) for messages
* Ability to set priority for messages
* Ability to set collapse-key for messages


Installation
------------

Use pip to install::

    $ pip install aiofcm


Basic Usage
-----------

.. code-block:: python

    from uuid import uuid4
    from aiofcm import FCM, Message, PRIORITY_HIGH


    async def run():
        fcm = FCM(123456789000, '<API_KEY>')
        message = Message(
            device_token='<DEVICE_TOKEN>',
            notification={           # optional
                "title": "Hello from Firebase",
                "body": "This is notification",
                "sound": "default"
            },
            data={"score": "3x1"},    # optional
            message_id=str(uuid4()),  # optional
            time_to_live=3,           # optional
            priority=PRIORITY_HIGH,   # optional
        )
        await fcm.send_message(message)

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run())


License
-------

aiofcm is developed and distributed under the Apache 2.0 license.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Fatal1ty/aiofcm",
    "name": "aiofcm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Alexander Tikhonov",
    "author_email": "random.gauss@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/65/4c/515e44a26c5e9c7496ea682ad6ca5400b3db6a23c922cd682b224c33b855/aiofcm-1.4.tar.gz",
    "platform": "all",
    "description": "aiofcm - An efficient Firebase Cloud Messaging Client Library for Python/asyncio\n=================================================================================\n\n.. image:: https://travis-ci.org/Fatal1ty/aiofcm.svg?branch=master\n    :target: https://travis-ci.org/Fatal1ty/aiofcm\n\n.. image:: https://img.shields.io/pypi/v/aiofcm.svg\n    :target: https://pypi.python.org/pypi/aiofcm\n\n.. image:: https://img.shields.io/pypi/pyversions/aiofcm.svg\n    :target: https://pypi.python.org/pypi/aiofcm/\n\n.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n    :target: https://opensource.org/licenses/Apache-2.0\n\n**aiofcm** is a library designed specifically for sending messages such as push-notifications\nto Android devices via Firebase Cloud Messaging platform. aiofcm provides an efficient client\nthrough asynchronous XMPP protocol for use with Python's ``asyncio``\nframework.\n\naiofcm requires Python 3.5 or later.\n\n\nPerformance\n-----------\n\nIn my testing aiofcm allows you to send on average 1k messages per second on a single core.\n\n\nFeatures\n--------\n\n* Internal connection pool which adapts to the current load\n* Sending notification and/or data messages\n* Ability to set TTL (time to live) for messages\n* Ability to set priority for messages\n* Ability to set collapse-key for messages\n\n\nInstallation\n------------\n\nUse pip to install::\n\n    $ pip install aiofcm\n\n\nBasic Usage\n-----------\n\n.. code-block:: python\n\n    from uuid import uuid4\n    from aiofcm import FCM, Message, PRIORITY_HIGH\n\n\n    async def run():\n        fcm = FCM(123456789000, '<API_KEY>')\n        message = Message(\n            device_token='<DEVICE_TOKEN>',\n            notification={           # optional\n                \"title\": \"Hello from Firebase\",\n                \"body\": \"This is notification\",\n                \"sound\": \"default\"\n            },\n            data={\"score\": \"3x1\"},    # optional\n            message_id=str(uuid4()),  # optional\n            time_to_live=3,           # optional\n            priority=PRIORITY_HIGH,   # optional\n        )\n        await fcm.send_message(message)\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(run())\n\n\nLicense\n-------\n\naiofcm is developed and distributed under the Apache 2.0 license.\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "An efficient Firebase Cloud Messaging Client Library for Python/asyncio",
    "version": "1.4",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "262f9bd60b441c9ec08a5e43f285089e06851bbfaf789d7dc4626b43375002d8",
                "md5": "fcf399852f225548441bab26ae9b27e0",
                "sha256": "41ed993a74f19fc9f82df16ca66a9f32d0f3a3d1d851d44d95c67b3078ab6700"
            },
            "downloads": -1,
            "filename": "aiofcm-1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fcf399852f225548441bab26ae9b27e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11438,
            "upload_time": "2023-03-14T09:39:51",
            "upload_time_iso_8601": "2023-03-14T09:39:51.212980Z",
            "url": "https://files.pythonhosted.org/packages/26/2f/9bd60b441c9ec08a5e43f285089e06851bbfaf789d7dc4626b43375002d8/aiofcm-1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "654c515e44a26c5e9c7496ea682ad6ca5400b3db6a23c922cd682b224c33b855",
                "md5": "69c688f7769b2fea963f603af7cab136",
                "sha256": "ff0e97c4f3d4db65a459ef44c485a80869f0567992a15b757942cb37b4b050d0"
            },
            "downloads": -1,
            "filename": "aiofcm-1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "69c688f7769b2fea963f603af7cab136",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11120,
            "upload_time": "2023-03-14T09:39:52",
            "upload_time_iso_8601": "2023-03-14T09:39:52.999993Z",
            "url": "https://files.pythonhosted.org/packages/65/4c/515e44a26c5e9c7496ea682ad6ca5400b3db6a23c922cd682b224c33b855/aiofcm-1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-14 09:39:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Fatal1ty",
    "github_project": "aiofcm",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiofcm"
}
        
Elapsed time: 0.04652s