{ "info": { "author": "Aaron Bach", "author_email": "bachya1208@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# \ud83c\udf24 aioambient: An async library for Ambient Weather Personal Weather Stations\n\n[![Travis CI](https://travis-ci.org/bachya/aioambient.svg?branch=master)](https://travis-ci.org/bachya/aioambient)\n[![PyPi](https://img.shields.io/pypi/v/aioambient.svg)](https://pypi.python.org/pypi/aioambient)\n[![Version](https://img.shields.io/pypi/pyversions/aioambient.svg)](https://pypi.python.org/pypi/aioambient)\n[![License](https://img.shields.io/pypi/l/aioambient.svg)](https://github.com/bachya/aioambient/blob/master/LICENSE)\n[![Code Coverage](https://codecov.io/gh/bachya/aioambient/branch/dev/graph/badge.svg)](https://codecov.io/gh/bachya/aioambient)\n[![Maintainability](https://api.codeclimate.com/v1/badges/81a9f8274abf325b2fa4/maintainability)](https://codeclimate.com/github/bachya/aioambient/maintainability)\n[![Say Thanks](https://img.shields.io/badge/SayThanks-!-1EAEDB.svg)](https://saythanks.io/to/bachya)\n\n`aioambient` is a Python3, asyncio-driven library that interfaces with both the\nREST and Websocket APIs provided by\n[Ambient Weather](https://ambientweather.net).\n\n# Installation\n\n```python\npip install aioambient\n```\n\n# Python Versions\n\n`aioambient` is currently supported on:\n\n* Python 3.6\n* Python 3.7\n\n# API and Application Keys\n\nUtilizing `aioambient` requires both an Application Key and an API Key from\nAmbient Weather. You can generate both from the Profile page in your\n[Ambient Weather Dashboard](https://dashboard.ambientweather.net).\n\n# Usage\n\n## Creating a Client\n\nAn `aioambient` client starts with an\n[aiohttp](https://aiohttp.readthedocs.io/en/stable/) `ClientSession`:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom aioambient import Client\n\n\nasync def main() -> None:\n \"\"\"Create the aiohttp session and run the example.\"\"\"\n async with ClientSession() as websession:\n # YOUR CODE HERE\n\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\nCreate a client, initialize it, then get to it:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom aioambient import Client\n\n\nasync def main() -> None:\n \"\"\"Create the aiohttp session and run the example.\"\"\"\n async with ClientSession() as websession:\n client = Client(\"\", \"\", websession)\n\n # Get all devices in an account:\n await client.api.get_devices()\n\n # Get all stored readings from a device:\n await client.api.get_device_details(\"\")\n\n # Get all stored readings from a device (starting at a datetime):\n await client.api.get_device_details(\n \"\", end_date=\"2019-01-16\"\n )\n\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\n## REST API\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom aioambient import Client\n\n\nasync def main() -> None:\n \"\"\"Create the aiohttp session and run the example.\"\"\"\n async with ClientSession() as websession:\n client = Client(\n '',\n '',\n websession)\n\n # Get all devices in an account:\n await client.api.get_devices()\n\n # Get all stored readings from a device:\n await client.api.get_device_details('')\n\n # Get all stored readings from a device (starting at a datetime):\n await client.api.get_device_details(\n '', end_date=\"2019-01-16\")\n\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\nPlease be aware of Ambient Weather's\n[rate limiting policies](https://ambientweather.docs.apiary.io/#introduction/rate-limiting).\n\n## Websocket API\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom aioambient import Client\n\n\nasync def main() -> None:\n \"\"\"Create the aiohttp session and run the example.\"\"\"\n async with ClientSession() as websession:\n client = Client(\"\", \"\", websession)\n\n # Define a method that should be fired when the websocket client\n # connects:\n def connect_method():\n \"\"\"Print a simple \"hello\" message.\"\"\"\n print(\"Client has connected to the websocket\")\n\n client.websocket.on_connect(connect_method)\n\n # Alternatively, define a coroutine handler:\n async def connect_coroutine():\n \"\"\"Waits for 3 seconds, then print a simple \"hello\" message.\"\"\"\n await asyncio.sleep(3)\n print(\"Client has connected to the websocket\")\n\n client.websocket.async_on_connect(connect_coroutine)\n\n # Define a method that should be run upon subscribing to the Ambient\n # Weather cloud:\n def subscribed_method(data):\n \"\"\"Print the data received upon subscribing.\"\"\"\n print(f\"Subscription data received: {data}\")\n\n client.websocket.on_subscribed(subscribed_method)\n\n # Alternatively, define a coroutine handler:\n async def subscribed_coroutine(data):\n \"\"\"Waits for 3 seconds, then print the incoming data.\"\"\"\n await asyncio.sleep(3)\n print(f\"Subscription data received: {data}\")\n\n client.websocket.async_on_subscribed(subscribed_coroutine)\n\n # Define a method that should be run upon receiving data:\n def data_method(data):\n \"\"\"Print the data received.\"\"\"\n print(f\"Data received: {data}\")\n\n client.websocket.on_data(data_method)\n\n # Alternatively, define a coroutine handler:\n async def data_coroutine(data):\n \"\"\"Wait for 3 seconds, then print the data received.\"\"\"\n await asyncio.sleep(3)\n print(f\"Data received: {data}\")\n\n client.websocket.async_on_data(data_coroutine)\n\n # Define a method that should be run when the websocket client\n # disconnects:\n def disconnect_method(data):\n \"\"\"Print a simple \"goodbye\" message.\"\"\"\n print(\"Client has disconnected from the websocket\")\n\n client.websocket.on_disconnect(disconnect_method)\n\n # Alternatively, define a coroutine handler:\n async def disconnect_coroutine(data):\n \"\"\"Wait for 3 seconds, then print a simple \"goodbye\" message.\"\"\"\n await asyncio.sleep(3)\n print(\"Client has disconnected from the websocket\")\n\n client.websocket.async_on_disconnect(disconnect_coroutine)\n\n # Connect to the websocket:\n await client.websocket.connect()\n\n # At any point, disconnect from the websocket:\n await client.websocket.disconnect()\n\n\nloop = asyncio.get_event_loop()\nloop.create_task(main())\nloop.run_forever()\n```\n\n# Contributing\n\n1. [Check for open features/bugs](https://github.com/bachya/aioambient/issues)\n or [initiate a discussion on one](https://github.com/bachya/aioambient/issues/new).\n2. [Fork the repository](https://github.com/bachya/aioambient/fork).\n3. Install the dev environment: `make init`.\n4. Enter the virtual environment: `pipenv shell`\n5. Code your new feature or bug fix.\n6. Write a test that covers your new functionality.\n7. Run tests and ensure 100% code coverage: `make coverage`\n8. Add yourself to `AUTHORS.md`.\n9. Submit a pull request!\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/bachya/aioambient", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aioambient", "package_url": "https://pypi.org/project/aioambient/", "platform": "", "project_url": "https://pypi.org/project/aioambient/", "project_urls": { "Homepage": "https://github.com/bachya/aioambient" }, "release_url": "https://pypi.org/project/aioambient/1.0.0/", "requires_dist": [ "aiohttp", "python-engineio (>=3.9.3)", "python-socketio[asyncio_client] (>=4.3.1)", "websockets" ], "requires_python": ">=3.6.0", "summary": "A clean, async-friendly library for the Ambient Weather API", "version": "1.0.0" }, "last_serial": 5788527, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0013c954f5b43f544136ab44cbbc4e95", "sha256": "04825c9ad848400e3d0daf2cf9425ecaceb9f1b59f4ae433f8c60be7f68020df" }, "downloads": -1, "filename": "aioambient-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0013c954f5b43f544136ab44cbbc4e95", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8144, "upload_time": "2019-01-22T05:54:03", "url": "https://files.pythonhosted.org/packages/af/63/37fe407fb2460017ccdd0c213178348ef41fdbbca4bf01bd9f141c92b1f9/aioambient-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd30812a481f2094a01e0dadcaa6fb50", "sha256": "8738a7ba71703f3a984b457c33a7ae382a7b7007b0514c329a4c9b7b4ad05de9" }, "downloads": -1, "filename": "aioambient-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cd30812a481f2094a01e0dadcaa6fb50", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 6736, "upload_time": "2019-01-22T05:54:05", "url": "https://files.pythonhosted.org/packages/22/cd/60cd2e0dbf50600f5225ea0bc20a8ae73775803b1ab45848e4aa5493d904/aioambient-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "293ccbc7477c829164a7b1b7be421c89", "sha256": "8085c013e367acda2df89a2cf6d03c73f6625490d2273edd2f5ce208f6747a3a" }, "downloads": -1, "filename": "aioambient-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "293ccbc7477c829164a7b1b7be421c89", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8238, "upload_time": "2019-02-12T23:47:20", "url": "https://files.pythonhosted.org/packages/92/17/37792c25968767d7341a78f640ea601f02a3ac60a030b7094b045d2328fe/aioambient-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60a454a7a2c08724f772891fca2ecf82", "sha256": "31b929670f39ae4c34c1a8bfb1bdaa67cab8fe71fe4d175b0e215ea5fec023a5" }, "downloads": -1, "filename": "aioambient-0.1.1.tar.gz", "has_sig": false, "md5_digest": "60a454a7a2c08724f772891fca2ecf82", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 6837, "upload_time": "2019-02-12T23:47:22", "url": "https://files.pythonhosted.org/packages/91/1d/b08c79ad9a8abce7f633d0a5b7dabb3618f856a8ae3419d7c4338f13c7d3/aioambient-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "ced27918c63b54937fdbeea6f31412c6", "sha256": "d6ccd1e33a64ea83e0863eeeccdbaaadb94ffc4fb8344f42eda3af03d9932eec" }, "downloads": -1, "filename": "aioambient-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ced27918c63b54937fdbeea6f31412c6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8238, "upload_time": "2019-02-15T18:04:27", "url": "https://files.pythonhosted.org/packages/62/11/5bdf22ace9a2f0e32f7f0dc6bb65af5d41f8a67f3dce3472ead4e7e56525/aioambient-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "230b0de3d6363a95858e5d8fbd2ad982", "sha256": "ab490f34e7a872f3580b1280028df419d877c4cbdbf118f3dbe73cd5237cc26d" }, "downloads": -1, "filename": "aioambient-0.1.2.tar.gz", "has_sig": false, "md5_digest": "230b0de3d6363a95858e5d8fbd2ad982", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 6843, "upload_time": "2019-02-15T18:04:28", "url": "https://files.pythonhosted.org/packages/a3/f6/7e12f639a53a94ac61f05f0276936c47dbdf8ab6617c0c7b788a8fdb7d85/aioambient-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "130831bb352382fa7e4d4021c12083a0", "sha256": "1bd6c8d4f99e14d439cbbef501f3324a7a4371cc114b68fa12f16246fdd76f95" }, "downloads": -1, "filename": "aioambient-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "130831bb352382fa7e4d4021c12083a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8235, "upload_time": "2019-02-28T00:07:55", "url": "https://files.pythonhosted.org/packages/1f/36/1520d38fcaf2226d460f231d34884c04a06e837bf468b0f84309cc5e93db/aioambient-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8e97bb683314b860f37d428a0bf768b", "sha256": "277de03992f5e1ae5786e9646778546b8865fc02347b162d25d90a73561e52ef" }, "downloads": -1, "filename": "aioambient-0.1.3.tar.gz", "has_sig": false, "md5_digest": "e8e97bb683314b860f37d428a0bf768b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 6836, "upload_time": "2019-02-28T00:07:56", "url": "https://files.pythonhosted.org/packages/62/5f/7ec1d57b53ccca3d6bd46b38f02a794e61e1c16b5776f9fa6e63ceca0767/aioambient-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "365243b1c3201b35845288a70a4bab30", "sha256": "b28f8bcc2a97551bbd9c32f0c2e5158f1804263a2f0b70ded5a22d3a5ebd7785" }, "downloads": -1, "filename": "aioambient-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "365243b1c3201b35845288a70a4bab30", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8238, "upload_time": "2019-04-04T18:19:39", "url": "https://files.pythonhosted.org/packages/a2/e2/043df83a33f0db209544954b05a367de77e971cac61bfb57268d184ae6df/aioambient-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c3ab52f760082a6f78111f00e1d2ed6", "sha256": "6b0219bc2d15908316fba22bb67cd2316cb2d5573dc51b7de365c6b944299a07" }, "downloads": -1, "filename": "aioambient-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6c3ab52f760082a6f78111f00e1d2ed6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 6835, "upload_time": "2019-04-04T18:19:41", "url": "https://files.pythonhosted.org/packages/a4/95/13f432398a8f9a499d3359d0910850c3930ac9c713433d7473df92538cda/aioambient-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "89e43095c8cfacee3931607279c0ca5c", "sha256": "2ed6a8aed2fdd97137eead6ab1e54a711b23c7b5c58f39843d2caaae1861969a" }, "downloads": -1, "filename": "aioambient-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "89e43095c8cfacee3931607279c0ca5c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8466, "upload_time": "2019-04-07T16:46:09", "url": "https://files.pythonhosted.org/packages/ec/48/873d22722d7eea020798892e02edd53896118e0ebc2195a9ad4a134e399f/aioambient-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eaf53a56c5d6093ce655db22e95ce967", "sha256": "686e49c2f252019d2ecb48391f8d5d9ecd5e05639b663b0cd49377094633438f" }, "downloads": -1, "filename": "aioambient-0.3.0.tar.gz", "has_sig": false, "md5_digest": "eaf53a56c5d6093ce655db22e95ce967", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 7081, "upload_time": "2019-04-07T16:46:11", "url": "https://files.pythonhosted.org/packages/44/3b/767c3fd24357f385aff46f730c90809c51d544f814c067f1c41739c0a89d/aioambient-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "f935771ede04dbd08cee989786517547", "sha256": "2fbf4abc2eb2638aec0e114735a93fe5f2a548020ddaed8c2295d029a9f0b66e" }, "downloads": -1, "filename": "aioambient-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f935771ede04dbd08cee989786517547", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8454, "upload_time": "2019-06-15T02:36:53", "url": "https://files.pythonhosted.org/packages/2d/13/cd52fedeb65898c5b88dc14976354a0a25086f89df218e9d586b159bc95c/aioambient-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a788ac59a868af607af7b7d6deb13c58", "sha256": "67dc10af38100cfa16707f34838fae82a05e68d80638f728d569f8bbcf5319dc" }, "downloads": -1, "filename": "aioambient-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a788ac59a868af607af7b7d6deb13c58", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 7159, "upload_time": "2019-06-15T02:36:55", "url": "https://files.pythonhosted.org/packages/36/17/7e7d8bd89d73541a24f02a1679e848acfb42ccb7051f7a6d63410b77389d/aioambient-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "64ed87f23822a610857eeb9e7eb68091", "sha256": "1c666aa0f2df9da05b9fb0c690b37171d2f5d51b6306cc3369e801424a895dae" }, "downloads": -1, "filename": "aioambient-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "64ed87f23822a610857eeb9e7eb68091", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 8456, "upload_time": "2019-08-14T23:57:36", "url": "https://files.pythonhosted.org/packages/00/ac/1d0a26072bacf324bcea75ffc7802c909d051c02327ce3fe3214c8d7346b/aioambient-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "666192ff4a3d0f256061c0ab85dc0e22", "sha256": "417768cb9f790e8adf5afb24258bd8694292049619af1140524c33607ae7c63e" }, "downloads": -1, "filename": "aioambient-0.3.2.tar.gz", "has_sig": false, "md5_digest": "666192ff4a3d0f256061c0ab85dc0e22", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 7157, "upload_time": "2019-08-14T23:57:37", "url": "https://files.pythonhosted.org/packages/ad/0e/26a97553d45e01a79be47a7378e524d114fbf1de0849f4d228dc9634dbb4/aioambient-0.3.2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b7f05e358b97d704040b6ac1cfd007c3", "sha256": "e6f172d38b15aa679ccc774b57c739a79d28a0ee673a3e2d2d38ec967e7295c6" }, "downloads": -1, "filename": "aioambient-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b7f05e358b97d704040b6ac1cfd007c3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 8428, "upload_time": "2019-09-05T21:25:33", "url": "https://files.pythonhosted.org/packages/44/34/a98fa8da5e5f81c76fdc1e4c1c799fd306058ce66169dde9d182617ee824/aioambient-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b974f84f1194464723cf1fd3b57c3d03", "sha256": "3b49a3eeff61ea8f7a0180f612e443a5a4a32d09318b59b916423d735117c09a" }, "downloads": -1, "filename": "aioambient-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b974f84f1194464723cf1fd3b57c3d03", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 7165, "upload_time": "2019-09-05T21:25:34", "url": "https://files.pythonhosted.org/packages/3f/42/8efda0ce240bdc29636870353b8b7082e5bbd9a4fb84a8d01e94e5fdd260/aioambient-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b7f05e358b97d704040b6ac1cfd007c3", "sha256": "e6f172d38b15aa679ccc774b57c739a79d28a0ee673a3e2d2d38ec967e7295c6" }, "downloads": -1, "filename": "aioambient-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b7f05e358b97d704040b6ac1cfd007c3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 8428, "upload_time": "2019-09-05T21:25:33", "url": "https://files.pythonhosted.org/packages/44/34/a98fa8da5e5f81c76fdc1e4c1c799fd306058ce66169dde9d182617ee824/aioambient-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b974f84f1194464723cf1fd3b57c3d03", "sha256": "3b49a3eeff61ea8f7a0180f612e443a5a4a32d09318b59b916423d735117c09a" }, "downloads": -1, "filename": "aioambient-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b974f84f1194464723cf1fd3b57c3d03", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 7165, "upload_time": "2019-09-05T21:25:34", "url": "https://files.pythonhosted.org/packages/3f/42/8efda0ce240bdc29636870353b8b7082e5bbd9a4fb84a8d01e94e5fdd260/aioambient-1.0.0.tar.gz" } ] }