Skip to content

A customizable, privacy-preserving Python project to track daily, weekly, and monthly life statistics using Google Forms and Google Sheets. Analyze your habits, receive feedback, and visualize your progress with an interactive dashboard.

Notifications You must be signed in to change notification settings

lucianatanzarella/life-stats-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Life Stats Tracker

A customizable, privacy-preserving Python project to track daily, weekly, and monthly life statistics using Google Forms and Google Sheets. Analyze your habits, receive feedback, and visualize your progress.

Features

  • Google Forms Integration: Collect life stats via Google Forms, responses auto-synced to Google Sheets.
  • Automated Data Fetching: Pull responses into pandas DataFrames using the Google Sheets API.
  • Habit Analysis: Detect streaks, improvements, and trends in your data.
  • Notifications: Receive daily/weekly summary emails with insights.
  • Interactive Dashboard: Visualize your stats and trends with Streamlit.
  • Highly Configurable: Choose which metrics to track, set notification preferences, and more.

Project Structure

life-stats-tracker/
├── config/
│   └── example_config.yaml
├── forms/
│   ├── daily_form_template.md
│   ├── weekly_form_template.md
│   └── monthly_form_template.md
├── src/
│   ├── fetch_responses.py
│   ├── analyze_habits.py
│   └── send_notifications.py
├── dashboard/
│   └── dashboard_app.py
├── .github/
│   └── workflows/
│       └── auto-update.yml
├── .gitignore
├── README.md
└── requirements.txt

Tutorial

1. Prerequisites

2. Clone and Install

# Clone the repository
https://github.com/lucianatanzarella/life-stats-tracker.git
cd life-stats-tracker

# Install dependencies
pip install -r requirements.txt

3. Configure Your Project

a. Copy and Edit the Config

cp config/example_config.yaml config/user_config.yaml
  • Open config/user_config.yaml in a text editor.
  • Fill in your Google Sheet ID, tab names, and (optionally) email credentials.
  • Your user_config.yaml is private and excluded from git.

b. Set Up Google API Credentials

  • Create a Google Cloud project and enable the Sheets API (and Gmail API if you want notifications).
  • Create a service account and download the credentials JSON file.
  • Place the credentials file in the credentials/ directory.
  • Share your Google Sheet with the service account email.

4. Create and Link Your Google Form

a. Create the Form

  • Go to Google Forms and create a new form.
  • Use the templates in forms/daily_form_template.md, forms/weekly_form_template.md, or forms/monthly_form_template.md as a guide.
  • Best Practices:
    • Use clear, unique question titles (e.g., "Sleep Hours", "Mood (1-10)").
    • Use numeric types (Short answer with number validation, or Linear scale) for stats.
    • Cover all metrics you want to track (see config metrics).

b. Link to Google Sheets

  • In your form, go to the Responses tab.
  • Click the green Sheets icon to create or select a Google Sheet.
  • Each form will create a new tab (worksheet) in the Sheet.
  • Rename the tab(s) to match your config (e.g., DailyResponses).

c. Test the Setup

  • Fill out the form once.
  • Check the Google Sheet for your response.
  • Make sure the column headers match your metrics.

5. Run the Project

a. Fetch Responses

python src/fetch_responses.py

b. Analyze Habits

python src/analyze_habits.py

c. Launch the Dashboard

streamlit run dashboard/dashboard_app.py

6. Privacy & Security

  • Your user_config.yaml and credentials are excluded from git by .gitignore.
  • Never share your credentials or sensitive config publicly.
  • Only share your Google Sheet with trusted accounts (e.g., your service account).

7. Troubleshooting

  • If you see import errors, make sure all dependencies are installed.
  • If the script can't access your Google Sheet, check sharing permissions and Sheet ID.
  • For API errors, verify your credentials and Google Cloud project setup.

Customization

  • Edit config/user_config.yaml to set your Sheet ID, tab names, email settings, tracked metrics, and notification preferences.
  • Modify form templates in forms/ as needed.

Privacy

  • No personal data is stored in the repository.
  • Sensitive files and data are excluded via .gitignore.

License

MIT

About

A customizable, privacy-preserving Python project to track daily, weekly, and monthly life statistics using Google Forms and Google Sheets. Analyze your habits, receive feedback, and visualize your progress with an interactive dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages