Giter Site home page Giter Site logo

bbt-chart's Introduction

BBT Chart

Body Basal Temperature must be taken at the same time every day and graphed for months in advance to prove as useful data for tracking ovulation. Typically, your BBT gets slightly higher after ovulation (detected 24-48 hours in advance by at-home LH tests) and drops when you begin menstruating. In this way, tracking your BBT is useful in confirming ovulation. BBT is also useful in detecting pregnancy, as your temperatures will stay high until you menstruate or get a positive pregnancy test. For these reasons, I have found it very helpful to visualize BBT data alongside markers for the first day of my cycle (begin menstruating) and positive LH tests.

BBT data, as well as cycle day and LH test markers, can be entered through the command line into a database of the user's choosing and then graphed using the Python library for Plotly.

Usage

Clone the repository and in your virtualenv install the requirements in requirements.txt

pip install -r requirements.txt

BBT Chart was created to enter information into a local PostgreSQL database by default. Create a database and enter your settings into a settings.py file.

db_info = {'database': 'your_database', 'user': 'your_username', 'password': 'your_password'}

Obtain a Plotly username and API Key and enter those into a file called credentials.py. Use the Plotly function for creating its credentials file.

import plotly

def set_credentials():
    plotly.tools.set_credentials_file(username='your_username', api_key='your_api_key')

Run create_table.py in the command line.

python create_table.py

Add your data from command line with add_data.py. The four arguments consist of the date (ex: 2016-12-14), temperature to two decimal places (ex: 97.21), a marker for the first day of your cycle (ex: cd1), and a marker for a positive LH test (ex: +). When not entering data for cycle days or LH tests, substitute with "-" (or character of your choice) to show a null value. Previous data can be added in this way as well; all dates get sorted before being graphed.

python add_data.py YYYY-MM-DD ##.## - -

python add_data.py 2016-12-14 97.21 cd1 +

Graph your chart from command line with run.py.

python run.py

Example chart:

chart

More options

To view all of the previously entered data, use print_data.py.

python print_data.py

Example output in terminal:

output

To delete an entry, use delete_entry.py and add the date to delete.

python delete_entry.py 2016-12-14

To edit the date, temperature, cycle day, and LH data, use the following files like so:

python edit_date.py 2016-12-14 2016-12-13

python edit_temp.py 2016-12-13 96.72

python edit_cd.py 2016-12-13 cd1

python edit_lh.py 2016-11-27 +

Features to add

  • Overlaid graph of average temperature
  • Set up cron job to grab latest tweet to bbt_chart account from user every day at specific time and add to database
  • Tweet from bbt_chart to confirm data added
  • Weekly post Plotly chart to Twitter and mention app user
  • Add argparse for options input from command line
  • Create as Python Package

License

MIT License

bbt-chart's People

Stargazers

Hagos Waterman avatar

Watchers

James Cloos avatar Lorena Guerra Matteucci avatar

Forkers

danopa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.