Data is most powerful when it reveals the uncomfortable truth. While the Pico W Mood-Tracker device focuses on the tactile "Click" to capture fleeting moments of joy or existential dread, this project applies rigorous descriptive statistics to analyze the wreckage.
We aren't just looking at feelings; we are calculating the mean, variance, and emotional trajectory of a human being who probably needs a nap.
This analytics suite is the second half of a two-part ecosystem:
- The Logger (PicoW-Mood-Tracker): An IoT device that logs moods to Google Sheets.
- The Analyzer (This Repo): A Python-based suite that fetches, processes, and visualizes that data.
- The Dashboard (Web): (NEW!) A Streamlit-powered realtime web interface for instant visual feedback.
By mapping qualitative mood labels to quantitative scores, the system calculates a Regression Slope to determine your emotional trajectory over time.
- Positive Slope: Indicates a steady upward trend in your well-being. Negative Slope: Suggests a downward trend, signaling a need for rest.
- 💡 Or just calculating if my happiness is trending upward or if I'm headed for a statistical anomaly.
This script analyzes the stability of your emotions through advanced statistical metrics:
- Standard Deviation (SD): Measures how much your mood scores deviate from the average.
- Average Mood Swing: Calculates the mean of absolute differences between consecutive records to quantify emotional turbulence.
- Volatility Visualization (VIX): A dedicated chart that plots score changes between entries to identify stability patterns.
- 💡 Or just measuring how quickly I flip from "I love my hobby" to "Why on earth am I doing this in my free time?"
- Frequency Analysis: Identify dominant emotions using Seaborn-powered bar charts.
- Time-Series Tracking: Maps every emotional data point over a timeline to identify specific patterns.
- Emoji WordCloud: Generates an intuitive visual cloud of your most frequently recorded emojis.
- 💡 Or just turning raw emotional chaos into pretty bar charts because numbers are annoying.
Skip the local scripts and monitor your emotional state directly in your web browser.
- Auto-Refresh: Automatically fetches and syncs with Google Sheets every 300 seconds (5 minutes) to keep your data current.
- Security: Features a built-in password protection layer to ensure your personal mood logs remain private.
Install the necessary dependencies:
pip install pandas seaborn matplotlib scikit-learn wordcloudUpdate the url variable in main.py with your Google Sheets CSV URL:
- Go to Google Sheets > File > Share > Publish to web.
- Select Comma-separated values (.csv) and click Publish.
- Copy and paste the link into the code.
For analysis: python3 main.py
Please ignore Korean. You'll see it in English.
You can host this dashboard for free using Streamlit Community Cloud, syncing it directly with your GitHub repository.
Ensure your repository contains the following essential files:
mood-web.py: The main application code. This code must be modified for your own google sheets' url of .csv and password before use.requirements.txt: List of dependencies includingstreamlit,pandas,matplotlib,seaborn,wordcloud, andscikit-learn.
Update the url variable in main.py with your Google Sheets CSV URL:
- Go to Google Sheets > File > Share > Publish to web.
- Select Comma-separated values (.csv) and click Publish.
- Copy and paste the link into the code.
- Log in to Streamlit Community Cloud using your GitHub account.
- Click "New app".
- Select your repository, branch (usually
main), and the main file path (mood-web.py).
- Public Repository: Streamlit can access and deploy your app instantly without extra configuration.
- Private Repository:
- During the "New app" setup, you must grant Streamlit permission to access your private repositories.
- Pro Tip: Use Streamlit Secrets (Advanced settings) to manage sensitive information like your Google Sheets URL or passwords instead of hardcoding them in the script.
- Auto-Update: Any changes you
git pushto your GitHub repository will be automatically detected and redeployed within seconds. - Universal Access: Once deployed, Streamlit provides a unique URL. You can access your mood dashboard instantly from any PC, Tablet, or Smartphone without any additional setup.
- Open the Shortcuts app.
- Tap the + icon (Top right) > Add Action.
- Search for "Open URLs" and select it.
- Paste your Streamlit Dashboard link into the URL field.
- Tap the Share icon (at the bottom) or the Settings icon (at the top) and select "Add to Home Screen".
- Choose your preferred name and a custom photo/icon for your dashboard.
- Copy your Streamlit Dashboard link to your clipboard.
- Long-press an empty space on your Home Screen.
- Tap Widgets and look for the Chrome or Browser category.
- Drag and drop the "Chrome Bookmark" or "Custom Shortcut" widget to your home screen.
- Select your dashboard from your bookmarks or paste the URL if prompted.
- This method bypasses common "Add to Home Screen" caching issues.
🤔 Why this way?: These native OS methods launch the URL fresh, preventing the 500 errors sometimes caused by the progressive web app (PWA) cache of the browser.







