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.
- 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.
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
- Python 3.8+
- A Google account
- Access to Google Forms and Google Sheets
# Clone the repository
https://github.com/lucianatanzarella/life-stats-tracker.git
cd life-stats-tracker
# Install dependencies
pip install -r requirements.txt
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.
- 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.
- Go to Google Forms and create a new form.
- Use the templates in
forms/daily_form_template.md
,forms/weekly_form_template.md
, orforms/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
).
- 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
).
- Fill out the form once.
- Check the Google Sheet for your response.
- Make sure the column headers match your metrics.
python src/fetch_responses.py
python src/analyze_habits.py
streamlit run dashboard/dashboard_app.py
- 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).
- 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.
- 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.
- No personal data is stored in the repository.
- Sensitive files and data are excluded via
.gitignore
.
MIT