{ "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# \ud83d\udcdf aionotion: a Python3, asyncio-friendly library for Notion\u00ae Home Monitoring\n\n[![Travis CI](https://travis-ci.org/bachya/aionotion.svg?branch=master)](https://travis-ci.org/bachya/aionotion)\n[![PyPi](https://img.shields.io/pypi/v/aionotion.svg)](https://pypi.python.org/pypi/aionotion)\n[![Version](https://img.shields.io/pypi/pyversions/aionotion.svg)](https://pypi.python.org/pypi/aionotion)\n[![License](https://img.shields.io/pypi/l/aionotion.svg)](https://github.com/bachya/aionotion/blob/master/LICENSE)\n[![Code Coverage](https://codecov.io/gh/bachya/aionotion/branch/master/graph/badge.svg)](https://codecov.io/gh/bachya/aionotion)\n[![Maintainability](https://api.codeclimate.com/v1/badges/bd79edca07c8e4529cba/maintainability)](https://codeclimate.com/github/bachya/aionotion/maintainability)\n[![Say Thanks](https://img.shields.io/badge/SayThanks-!-1EAEDB.svg)](https://saythanks.io/to/bachya)\n\n`aionotion` is a Python 3, asyncio-friendly library for interacting with\n[Notion](https://getnotion.com) home monitoring sensors.\n\n# Python Versions\n\n`aionotion` is currently supported on:\n\n* Python 3.6\n* Python 3.7\n\n# Installation\n\n```python\npip install aionotion\n```\n\n# Usage\n\n`aionotion` starts within an\n[aiohttp](https://aiohttp.readthedocs.io/en/stable/) `ClientSession`:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\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 and get to work:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom aionotion import async_get_client\n\n\nasync def main() -> None:\n \"\"\"Create the aiohttp session and run the example.\"\"\"\n async with ClientSession() as websession:\n # Create a Notion API client:\n client = await async_get_client('', '', websession)\n\n # Get all \"households\" associated with the account:\n systems = await client.system.async_all()\n\n # Get a system by ID:\n system = await client.system.async_get(12345)\n\n # Create a system (with associated parameters):\n await client.system.async_create({\"system_id\": 12345, \"name\": \"Test\"})\n\n # Update a system with new parameters:\n await client.system.async_update(12345, {\"name\": \"Test\"})\n\n # Delete a system by ID:\n await client.system.async_delete(12345)\n\n # Get all bridges associated with the account:\n bridges = await client.bridge.async_all()\n\n # Get a bridge by ID:\n bridge = await client.bridge.async_get(12345)\n\n # Create a bridge (with associated parameters):\n await client.bridge.async_create({\"system_id\": 12345, \"name\": \"Test\"})\n\n # Update a bridge with new parameters:\n await client.bridge.async_update(12345, {\"name\": \"Test\"})\n\n # Reset a bridge (deprovision its WiFi credentials):\n await client.bridge.async_reset(12345)\n\n # Delete a bridge by ID:\n await client.bridge.async_delete(12345)\n\n # Get all devices associated with the account:\n devices = await client.device.async_all()\n\n # Get a device by ID:\n device = await client.device.async_get(12345)\n\n # Create a device (with associated parameters):\n await client.device.async_create({\"id\": 12345})\n\n # Delete a device by ID:\n await client.device.async_delete(12345)\n\n # Get all sensors:\n sensors = await client.sensor.async_all()\n\n # Get a sensor by ID:\n sensor = await client.sensor.async_get(12345)\n\n # Create a sensor (with associated parameters):\n await client.sensor.async_create({\"sensor_id\": 12345, \"name\": \"Test\"})\n\n # Update a sensor with new parameters:\n await client.sensor.async_update(12345, {\"name\": \"Test\"})\n\n # Delete a sensor by ID:\n await client.sensor.async_delete(12345)\n\n # Get all \"tasks\" (conditions monitored by sensors) associated with the account:\n tasks = await client.task.async_all()\n\n # Get a task by ID:\n task = await client.task.async_get(\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\")\n\n # Get a task's value history between two datetimes:\n import datetime\n history = await client.task.async_history(\n \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n data_before=datetime.datetime.now(),\n data_after=datetime.datetime.now() - datetime.timedelta(days=3),\n )\n\n # Create a list of tasks for a particular sensor (e.g., sensor # 12345):\n await client.task.async_create(\n 12345, [{\"id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", \"type\": \"missing\"}]\n )\n\n # Delete a task for a particular sensor (e.g., sensor # 12345):\n await client.task.async_delete(12345, \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\")\n\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\nCheck out `example.py`, the tests, and the source files themselves for method\nsignatures and more examples.\n\n# Contributing\n\n1. [Check for open features/bugs](https://github.com/bachya/aionotion/issues)\n or [initiate a discussion on one](https://github.com/bachya/aionotion/issues/new).\n2. [Fork the repository](https://github.com/bachya/aionotion/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/aionotion", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aionotion", "package_url": "https://pypi.org/project/aionotion/", "platform": "", "project_url": "https://pypi.org/project/aionotion/", "project_urls": { "Homepage": "https://github.com/bachya/aionotion" }, "release_url": "https://pypi.org/project/aionotion/2.0.0/", "requires_dist": [ "aiohttp" ], "requires_python": ">=3.6.0", "summary": "A simple Python 3 library for Notion Home Monitoring", "version": "2.0.0" }, "last_serial": 5788614, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2aea394cafe73f8e57cd88a6dd127228", "sha256": "96b56302e30add0cc9ecfe8c2455ef0dfc25de8c8af2d74268e5061d5cafb861" }, "downloads": -1, "filename": "aionotion-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2aea394cafe73f8e57cd88a6dd127228", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 6814, "upload_time": "2019-04-30T19:20:12", "url": "https://files.pythonhosted.org/packages/56/ee/0d4ff78ccdeaa83b759549d5a63eeb074f199f5a7ac4bf59fa2130ed6e66/aionotion-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "925db5bb480c6f3df8bab3c47b60f727", "sha256": "3c77f21f4e7ec06d1e8652714fb16947b450e03594c1243bad57ac8ca1f7e143" }, "downloads": -1, "filename": "aionotion-0.1.0.tar.gz", "has_sig": false, "md5_digest": "925db5bb480c6f3df8bab3c47b60f727", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 6100, "upload_time": "2019-04-30T19:20:26", "url": "https://files.pythonhosted.org/packages/97/c7/e553e35f4448beeee7a54e1ca6af924f1c0abd5b24e1ad4022cba045cc60/aionotion-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "83bfb039adc90180f63b2fd58c74fce5", "sha256": "5126e6978bf05f02bc6d988e698d78707829938294c43629dd5eafd9c07dbf14" }, "downloads": -1, "filename": "aionotion-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "83bfb039adc90180f63b2fd58c74fce5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 13051, "upload_time": "2019-06-18T18:20:02", "url": "https://files.pythonhosted.org/packages/34/9a/5e5a9ec691f965d49e51ba88ecada9ab57df92a28bf5e5e2cf58504fe34c/aionotion-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f6ee577d193d35c06885dfea20e668e", "sha256": "9e6006022276aabb80ac2eb7e2ba11647991995833038d0bad5fe93dc7382cef" }, "downloads": -1, "filename": "aionotion-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9f6ee577d193d35c06885dfea20e668e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 9488, "upload_time": "2019-06-18T18:20:04", "url": "https://files.pythonhosted.org/packages/32/e2/6f4d17793acb853a0e7c07c4a7e6996b272f08d471c1cecaf27a7de2d96f/aionotion-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "dab830f5fcff6a349ae9791a152c2e85", "sha256": "4654d94d4709ea3f387035ffa8d8fb204cb855cfdace98b73caccfd09021f04e" }, "downloads": -1, "filename": "aionotion-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dab830f5fcff6a349ae9791a152c2e85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 13175, "upload_time": "2019-07-03T02:59:44", "url": "https://files.pythonhosted.org/packages/e0/95/11532a14c582b056eac6343b3cfee7da90b81c6bd4a062fea67e8b219f70/aionotion-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a000a65419ab991048214d05f5296de", "sha256": "fa3b50a3f4bde7e83d06ac673c90cebc3a7d72a534deff194afed0c523ef8d99" }, "downloads": -1, "filename": "aionotion-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5a000a65419ab991048214d05f5296de", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 9543, "upload_time": "2019-07-03T02:59:45", "url": "https://files.pythonhosted.org/packages/04/71/856624fffc3901e7ed51d169cb4734631300bfa6abeef65806edb08b3a83/aionotion-1.1.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "15d007fbab820ad9188f1faab37467f6", "sha256": "9c86e8d759e4bd0fa63d838488ea27f93528dc775cfa92f7714aef21e03ae988" }, "downloads": -1, "filename": "aionotion-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "15d007fbab820ad9188f1faab37467f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 12987, "upload_time": "2019-09-05T21:54:55", "url": "https://files.pythonhosted.org/packages/42/12/460cfa7e2da52816cfe50aa25a66ba997d69820163a38d51a018a6707b5b/aionotion-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e1f458dd7ed636109f976fb782bb2db", "sha256": "b3ea19c506713a1b87656c740dd8159ff7e6962682203af9839439b5fac51bec" }, "downloads": -1, "filename": "aionotion-2.0.0.tar.gz", "has_sig": false, "md5_digest": "2e1f458dd7ed636109f976fb782bb2db", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 9439, "upload_time": "2019-09-05T21:54:57", "url": "https://files.pythonhosted.org/packages/a2/c0/24418c8983a43d1c64a0a75551e3b050ffa095ca88bc5070fe5e2e5a0df3/aionotion-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "15d007fbab820ad9188f1faab37467f6", "sha256": "9c86e8d759e4bd0fa63d838488ea27f93528dc775cfa92f7714aef21e03ae988" }, "downloads": -1, "filename": "aionotion-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "15d007fbab820ad9188f1faab37467f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 12987, "upload_time": "2019-09-05T21:54:55", "url": "https://files.pythonhosted.org/packages/42/12/460cfa7e2da52816cfe50aa25a66ba997d69820163a38d51a018a6707b5b/aionotion-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e1f458dd7ed636109f976fb782bb2db", "sha256": "b3ea19c506713a1b87656c740dd8159ff7e6962682203af9839439b5fac51bec" }, "downloads": -1, "filename": "aionotion-2.0.0.tar.gz", "has_sig": false, "md5_digest": "2e1f458dd7ed636109f976fb782bb2db", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 9439, "upload_time": "2019-09-05T21:54:57", "url": "https://files.pythonhosted.org/packages/a2/c0/24418c8983a43d1c64a0a75551e3b050ffa095ca88bc5070fe5e2e5a0df3/aionotion-2.0.0.tar.gz" } ] }