deanlyoung / python_awair

WIP Python library for the Awair GraphQL API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python_awair

Latest PyPI version Latest Travis CI build status Coveralls

This is a WIP library to access the Awair API. Features:

  • uses graphql to access data (not sure if that's really a feature, but it's cool).
  • async friendly!

Not yet supported:

  • graphql mutations. There aren't docs on the developer site yet. We may implement them via REST.
  • anything other than hobbyist-level endpoints (eg, no organizations)

Getting started:

Usage:

from python_awair import AwairClient
import aiohttp
import asyncio

async def test_it():
  session = aiohttp.ClientSession()
  client = AwairClient('your_access_token', session=session)
  result = await client.air_data_latest("device_uuid")
  print(result)
  await session.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.ensure_future(test_it()))
loop.close()

About

WIP Python library for the Awair GraphQL API

License:MIT License


Languages

Language:Python 100.0%