vangorra / python_withings_api

Library for the Withings Health API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use from a script?

crhuber opened this issue · comments

Thanks for the great module.
How would one use this in a script to get my own measurements? Once I have the credentials, can I continue to use them in a long lived process?
For example, once Ive gone through the oauth steps can I continue to use those creds to get measurements at a later date?

The integration test demonstrates how to retrieve data and persist credentials between runs. The integration test is only one example, implementation of credential storage or process longevity depends on your needs.

With oauth, refreshing credentials is necessary but automatically handled by the code. If you request data every hour, the token will be refreshed. You are responsible for storing those updated credentials. The callback for credential changes is provided as an argument to the WithingsApi class.