{ "info": { "author": "Jonathon Green", "author_email": "aeirsoul@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Build Tools" ], "description": "# Python Pushover Open Client\npy-pushover-open-client aims to provide unofficial Python bindings for [Pushover's Open Client API](https://pushover.net/api/client).\n\n## Usage\n\n### Setup\n\n```\npip3 install py-pushover-open-client \n```\n\nOr simply clone this repository, change into it's root directory and run \"pip3 install .\"\n\n### How to Use\nYou can now import the main client using:\n```python\nfrom pushover_open_client import Client\n```\n\nPlease see the examples provided for more detail.\n\n#### Device Registration\nThe first step is to register a new desktop device with the Pushover servers. This gives us certain device properties, specifically a secret, user key and device key, which can be saved and used by our client to recieve messages. \n\nTo do this, you must setup a configuration file in JSON format containing your Pushover's email and password as below:\n\n```\n{\n\t\"email\": \"myPushoverEmail@example.com\",\n\t\"password\": \"myPushoverPassword\",\n\t\"secret\": \"\",\n\t\"deviceID\": \"\",\n\t\"userID\": \"\"\n}\n```\n\n\nThen run code that looks like below. Replace \"*deviceName*\" with a device name between 0 and 25 characters long, \"*yourInConfig.cfg*\" with the name of your input configuration file, and \"*yourOutConfig.cfg*\" with the name intended for your output configuration file. \n*Note: These can be the same name if you wish.*\n\n```python\nfrom pushover_open_client import Client\n\nclient = Client(\"yourInConfig.cfg\")\nclient.login()\nclient.registerDevice(\"deviceName\")\nclient.writeConfig(\"yourOutConfig.cfg\")\n```\n\nAssuming the *deviceName* has not already been taken, your new device will be registered! \n\n*Note: If you receive an error message saying you could not register the device, try changing the name to be a unique name.*\n\n#### Receiving Messages\nOnce you have completed registration of the device, you want to continue to use the output configuration file which was written during registration. This will contain the information needed to log in to the servers and to receive messages.\n\nWhen you initially start a client, you will want to flush out any previously recorded messages. This is also a good way to test that your registration has been successful, as you will receive at least one test message from Pushover.\n\nTo do this, start a new session using the written configuration and get any outstanding messages as below:\n```python\nclient = Client(\"yourOutConfig.cfg\")\nmessageList = client.getOustandingMessages()\n\n#Process/do work with messageList\nif(messageList):\n\tfor m in messageList:\n\t\tprint m.message\n\n\tclient.deleteMessages(messageList[-1].id)\n```\n\nAfter you have flushed out any previous messages, you can connect to the websocket to receive real time messages! This can be done in one of two methods - via **polling**, or via passing in a **callback function** (recommended). Here are examples of both:\n\n##### **Polling:**\n```python\nwhile(True):\n\tmessageList = client.getWebSocketMessages()\n\n\t#Prcoess/do work with messageList!\n\tif(messageList):\n\t\tfor message in messageList:\n\n\t\t\t#Do work with message here!\n\n\t\t\t#Make sure to acknowledge messages with priority >= 2\n\t\t\tif(message.priority >= 2):\n\t\t\t\tclient.acknowledgeEmergency(message.receipt)\t\t\t\n\n\t\t#Make sure you delete messages that you recieve!\n\t\tclient.deleteMessages(messageList[-1].id)\n\n\tsleep(5) #Wait a few seconds between requests\n```\n\n##### **Callback:**\n```python\ndef messageCallback(messageList):\n\t#Prcoess/do work with messageList!\n\tif(messageList):\n\t\tfor message in messageList:\n\n\t\t\t#Do work with message here!\n\n\t\t\t#Make sure to acknowledge messages with priority >= 2\n\t\t\tif(message.priority >= 2):\n\t\t\t\tclient.acknowledgeEmergency(message.receipt)\t\t\t\n\n\t\t#Make sure you delete messages that you recieve!\n\t\tclient.deleteMessages(messageList[-1].id)\n\nclient.getWebSocketMessages(messageCallback)\t\n```\n\n**_And that's it!_** Please remember to be responsible when accessing Pushover's API!\n\n#### Message Object\nPlease see [the open client documentation](https://pushover.net/api/client#download) for information regarding what each message contains. Conditional elements are set to None if they do not exist to prevent exceptions.\n```\nAll Messages Include:\nid, umid, title, message, app, aid, icon, date, priority\n\nSome Messages Conditionally Include: \nsound, url, url_title, acked, receipt, html\n```\n\n## Acknowledgments\nThanks to the developers of:\n* websocket-client\n* requests\n\nThis client is not written or supported by Superblock, the creators of Pushover.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jonogreenz/py-pushover-open-client", "keywords": "pushover", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "py-pushover-open-client", "package_url": "https://pypi.org/project/py-pushover-open-client/", "platform": "", "project_url": "https://pypi.org/project/py-pushover-open-client/", "project_urls": { "Homepage": "https://github.com/jonogreenz/py-pushover-open-client" }, "release_url": "https://pypi.org/project/py-pushover-open-client/1.3.0/", "requires_dist": [ "requests (>=2.14.0)", "websocket-client (>=0.48.0)" ], "requires_python": "", "summary": "Unofficial Python Bindings for PushOver Open Client API", "version": "1.3.0" }, "last_serial": 5140451, "releases": { "1.1.1": [ { "comment_text": "", "digests": { "md5": "99d8afef0250ee5226c6a307da548786", "sha256": "f53fd8eb6fee85ef237c6f8d2d414e3893c208d27f385a72ebe217cee09239d0" }, "downloads": -1, "filename": "py_pushover_open_client-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "99d8afef0250ee5226c6a307da548786", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7788, "upload_time": "2018-07-01T10:05:35", "url": "https://files.pythonhosted.org/packages/03/2f/89bcf99980e3c70b47597951f1c24e874f57c0e265a0b43849c008af936a/py_pushover_open_client-1.1.1-py3-none-any.whl" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "1fa7955b0162a3ee97a5cd8720ed2037", "sha256": "419e09af7adc529d50f35dd5e43d9a533b9634900ccf45d48f2016f4ae02476e" }, "downloads": -1, "filename": "py_pushover_open_client-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1fa7955b0162a3ee97a5cd8720ed2037", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8640, "upload_time": "2018-11-11T06:06:57", "url": "https://files.pythonhosted.org/packages/9f/d8/fd300d6ef848948c95124e4a0f848f7be34b60510779ca279219b1b33830/py_pushover_open_client-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4519dae13c6a590cbe45b2d8c3e5c79c", "sha256": "527457a1a796d4b1780cf9726515488547f0009f9bba84cb91d0203049b30c45" }, "downloads": -1, "filename": "py_pushover_open_client-1.2.1.tar.gz", "has_sig": false, "md5_digest": "4519dae13c6a590cbe45b2d8c3e5c79c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7518, "upload_time": "2018-11-11T06:06:59", "url": "https://files.pythonhosted.org/packages/0e/0d/dc3675ce87827da4def90d45e33cb0e9e4f977a01100f413071cb8b74821/py_pushover_open_client-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "ce7dd90556517a3927fd31110e00469c", "sha256": "4e8eb5df85b4f317f9c339e1e1596b78e897ac05aa2bac530543e959ff9267d5" }, "downloads": -1, "filename": "py_pushover_open_client-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ce7dd90556517a3927fd31110e00469c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8658, "upload_time": "2018-11-27T01:29:28", "url": "https://files.pythonhosted.org/packages/51/69/a7a243189e1cd04e9c412a2e70bf7c50e00e107893b03d3cecc80ba674ee/py_pushover_open_client-1.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c9d1390ff87a41195e8eaf05e5d149b6", "sha256": "cebf88b5174dbb23881aaba90cf293913c6b3e9e9e5b37b1f9c96b93f6c9d6c6" }, "downloads": -1, "filename": "py_pushover_open_client-1.2.2.tar.gz", "has_sig": false, "md5_digest": "c9d1390ff87a41195e8eaf05e5d149b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7601, "upload_time": "2018-11-27T01:29:31", "url": "https://files.pythonhosted.org/packages/c7/a0/5a4ab9ea00f1ac542b6d9beffbb7d08916381d982daa35d00daa851d049c/py_pushover_open_client-1.2.2.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "04d6175c0f6ec81a7f0d2f18b4062148", "sha256": "003f181722cfa6e719f83444615c9154e43760cd98e312fabde2bfabe983f45f" }, "downloads": -1, "filename": "py_pushover_open_client-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "04d6175c0f6ec81a7f0d2f18b4062148", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8803, "upload_time": "2019-04-14T10:34:03", "url": "https://files.pythonhosted.org/packages/9d/dc/f3e91813ad786e17c42ff88f98b40051b1d25fa0d23077640b8d779fcf8d/py_pushover_open_client-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b1fc093cd76a8d6039cf36eefbacc36", "sha256": "cb5281b67ef75c17664981a56a0628a5d02f49efc5bf0533b24db34938be92a1" }, "downloads": -1, "filename": "py_pushover_open_client-1.3.0.tar.gz", "has_sig": false, "md5_digest": "0b1fc093cd76a8d6039cf36eefbacc36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7652, "upload_time": "2019-04-14T10:34:05", "url": "https://files.pythonhosted.org/packages/9f/1e/37d0a829e3d80b9b438259f9a619973f1fdb6b36b11f722908917866a13c/py_pushover_open_client-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04d6175c0f6ec81a7f0d2f18b4062148", "sha256": "003f181722cfa6e719f83444615c9154e43760cd98e312fabde2bfabe983f45f" }, "downloads": -1, "filename": "py_pushover_open_client-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "04d6175c0f6ec81a7f0d2f18b4062148", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8803, "upload_time": "2019-04-14T10:34:03", "url": "https://files.pythonhosted.org/packages/9d/dc/f3e91813ad786e17c42ff88f98b40051b1d25fa0d23077640b8d779fcf8d/py_pushover_open_client-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b1fc093cd76a8d6039cf36eefbacc36", "sha256": "cb5281b67ef75c17664981a56a0628a5d02f49efc5bf0533b24db34938be92a1" }, "downloads": -1, "filename": "py_pushover_open_client-1.3.0.tar.gz", "has_sig": false, "md5_digest": "0b1fc093cd76a8d6039cf36eefbacc36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7652, "upload_time": "2019-04-14T10:34:05", "url": "https://files.pythonhosted.org/packages/9f/1e/37d0a829e3d80b9b438259f9a619973f1fdb6b36b11f722908917866a13c/py_pushover_open_client-1.3.0.tar.gz" } ] }