# milasdk
Python SDK for Mila Air Purifiers.
The primary goal is to use this to power integrations for [Home Assistant](https://www.home-assistant.io/).
## Installation
```pip install milasdk```
## Usage
### Simple example
```
async def main():
logging.basicConfig(level=logging.DEBUG, format='%(asctime)-15s %(levelname)-8s %(message)s')
#create the authenticated session
async with DefaultAsyncSession(aiohttp.ClientSession(), USERNAME, PASSWORD) as session:
api = MilaApi(session)
while True:
await update(api)
await asyncio.sleep(60)
```
Please see `simple_example.py` for a full working example of usage of this library.
## Objects
### MilaAPI
The main client class that handles communications between the client and Mila service using GraphQL
## API Overview
The Mila GraphQL schema can be found in [mila_schema.gql](milasdk/gql/mila_schema.gql).
Raw data
{
"_id": null,
"home_page": "https://github.com/tombrien/milasdklite",
"name": "milasdklite",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Tom brien",
"author_email": "tom@tombrien.io",
"download_url": "https://files.pythonhosted.org/packages/30/72/505a50cc452bc95e3e5daf0407a4be363779cc7962a2ba094a8e9cdb5a4d/milasdklite-0.0.2.tar.gz",
"platform": null,
"description": "# milasdk\r\nPython SDK for Mila Air Purifiers.\r\nThe primary goal is to use this to power integrations for [Home Assistant](https://www.home-assistant.io/).\r\n\r\n## Installation\r\n```pip install milasdk```\r\n\r\n## Usage\r\n### Simple example\r\n\r\n```\r\nasync def main():\r\n logging.basicConfig(level=logging.DEBUG, format='%(asctime)-15s %(levelname)-8s %(message)s')\r\n\r\n #create the authenticated session\r\n async with DefaultAsyncSession(aiohttp.ClientSession(), USERNAME, PASSWORD) as session:\r\n api = MilaApi(session)\r\n\r\n while True:\r\n await update(api)\r\n await asyncio.sleep(60)\r\n```\r\n\r\nPlease see `simple_example.py` for a full working example of usage of this library.\r\n\r\n## Objects\r\n### MilaAPI\r\nThe main client class that handles communications between the client and Mila service using GraphQL\r\n\r\n## API Overview\r\nThe Mila GraphQL schema can be found in [mila_schema.gql](milasdk/gql/mila_schema.gql).\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python SDK for Mila Air Purifiers",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/tombrien/milasdklite"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c9d27f9f1cbd99208dfc75e0e990c47e2c94b172842054d97b1b097a0db21ad9",
"md5": "5b289a66c7eb87fb81b86fcf60a8dad2",
"sha256": "ece10277221fb9e283da7aefe16baad3b3793eee3214c6a4adf8c58145e3adcd"
},
"downloads": -1,
"filename": "milasdklite-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b289a66c7eb87fb81b86fcf60a8dad2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 19634,
"upload_time": "2024-08-27T09:48:31",
"upload_time_iso_8601": "2024-08-27T09:48:31.870271Z",
"url": "https://files.pythonhosted.org/packages/c9/d2/7f9f1cbd99208dfc75e0e990c47e2c94b172842054d97b1b097a0db21ad9/milasdklite-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3072505a50cc452bc95e3e5daf0407a4be363779cc7962a2ba094a8e9cdb5a4d",
"md5": "8bcaafb5aa2e6dfc95706b5c5d93ca6e",
"sha256": "c167471d7198cddfd7681392a05309c7d9032ec675934af82d1b3b2f627dc972"
},
"downloads": -1,
"filename": "milasdklite-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "8bcaafb5aa2e6dfc95706b5c5d93ca6e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16799,
"upload_time": "2024-08-27T09:48:33",
"upload_time_iso_8601": "2024-08-27T09:48:33.651536Z",
"url": "https://files.pythonhosted.org/packages/30/72/505a50cc452bc95e3e5daf0407a4be363779cc7962a2ba094a8e9cdb5a4d/milasdklite-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-27 09:48:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tombrien",
"github_project": "milasdklite",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "milasdklite"
}