In [1]:
import pandas as pd
from memair import Memair
# Use Otto the sandbox user's access token or create your own at https://memair.com/temporary_access_token
access_token = '0000000000000000000000000000000000000000000000000000000000000000'

user = Memair(access_token)
In [2]:
user = Memair(access_token)
query = '''
{
  Biometrics(
    first: 10000
    order: asc
    order_by: timestamp
    type:  weight
  ) {
    value
    timestamp
  }
}
'''
response = user.query(query)

weights = pd.DataFrame.from_dict(response['data']['Biometrics'])
weights['timestamp'] = pd.to_datetime(weights['timestamp'])
weights.set_index('timestamp', inplace=True)
In [4]:
weights.plot()
Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x11552fba8>