The API of the Beddit Sleep Tracker returns data in json format and this Python script converts the json into csv format.