Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giginet/beddit-python
API Client for Beddit Sleep Tracker :sleeping:
https://github.com/giginet/beddit-python
Last synced: 3 months ago
JSON representation
API Client for Beddit Sleep Tracker :sleeping:
- Host: GitHub
- URL: https://github.com/giginet/beddit-python
- Owner: giginet
- License: mit
- Created: 2016-08-14T14:12:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T07:46:12.000Z (almost 8 years ago)
- Last Synced: 2024-09-14T10:01:41.048Z (4 months ago)
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 10
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
beddit-python
============================
.. image:: https://travis-ci.org/giginet/beddit-python.svg?branch=master
:target: https://travis-ci.org/giginet/beddit-python
.. image:: https://coveralls.io/repos/github/giginet/beddit-python/badge.svg?branch=master
:target: https://coveralls.io/github/giginet/beddit-python?branch=masterAPI Client for Beddit_ in Python.
.. _Beddit: http://www.beddit.com
Read `API Documentation`_ for detail.
.. _API Documentation: https://github.com/beddit/beddit-api
Installation
---------------------.. code:: sh
pip install beddit-python
Usage
--------------List sleep scores per day
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.. code:: python
from datetime import datetime
from beddit.client import BedditClientclient = BedditClient('[email protected]', password)
start_date = datetime(2016, 7, 1)
end_date = datetime(2016, 7, 31)sleeps = client.get_sleeps(start=start_date, end=end_date)
for sleep in sleeps:
print(sleep.date.strftime('%Y-%m-%d'), sleep.property.total_sleep_score).. code:: txt
2016-07-01 75
2016-07-02 92
....Get user information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~.. code:: python
import os
from beddit.client import BedditClientclient = BedditClient(os.environ.get('BEDDIT_USERNAME'), os.environ.get('BEDDIT_PASSWORD'))
user = client.get_user()
print(user.name)
print(user.height)
print(user.weight)Supported Python
------------------------Python 2.7, 3.3, 3.4, 3.5
LICENSE
----------------MIT License