Project 24: Emoji Mood Tracker 😊¢

Difficulty: 🟒 Beginner

Run cells top to bottom. Each step builds on the previous one and saves real files under outputs/emoji_mood_tracker/.

← Back to index

DescriptionΒΆ

Log daily moods with emojis, score them, and plot a cheerful week-of-feelings chart.

Libraries & ModulesΒΆ

  • matplotlib.pyplot
  • Built-in: datetime

Python Concepts You'll PracticeΒΆ

Dicts as lookups, list aggregations, simple charts

πŸŽ›οΈ Parameter VariationsΒΆ

  • MOOD_LOG β€” swap emoji days
  • SCORES β€” remap how happy each emoji is
InΒ [1]:
# Install dependencies for this project (safe to re-run)
import sys
!{sys.executable} -m pip install pillow numpy matplotlib wordcloud qrcode[pil] python-barcode fpdf2 jinja2 folium plotly pandas scipy ipywidgets -q
Skipping pip install (already installed)
InΒ [2]:
# Interactive Jupyter setup β€” run this cell first
%matplotlib inline

from pathlib import Path
from IPython.display import display, Image as IPImage, HTML, Markdown, Audio, IFrame

OUTPUT_DIR = Path("outputs") / "emoji_mood_tracker"
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
print(f"βœ… Outputs folder: {OUTPUT_DIR.resolve()}")
βœ… Outputs folder: C:\Users\Hansel Yan\Projects\CodeItAll\outputs\emoji_mood_tracker

Step 1 β€” Score a week of moodsΒΆ

InΒ [3]:
from datetime import date, timedelta

# πŸŽ›οΈ TWEAK THESE
MOOD_LOG = ["πŸ˜€", "😐", "😎", "😴", "🀩", "😀", "πŸ₯³"]
SCORES = {"πŸ˜€": 4, "😐": 2, "😎": 4, "😴": 1, "🀩": 5, "😀": 1, "πŸ₯³": 5, "😒": 0}

start = date(2026, 7, 6)
days = [start + timedelta(days=i) for i in range(len(MOOD_LOG))]
points = [SCORES.get(m, 2) for m in MOOD_LOG]
avg = sum(points) / len(points)
print(f"Average mood score: {avg:.2f} / 5")
for d, m, p in zip(days, MOOD_LOG, points):
    print(f"{d:%a %b %d}: {m} ({p})")
Average mood score: 3.14 / 5
Mon Jul 06: πŸ˜€ (4)
Tue Jul 07: 😐 (2)
Wed Jul 08: 😎 (4)
Thu Jul 09: 😴 (1)
Fri Jul 10: 🀩 (5)
Sat Jul 11: 😀 (1)
Sun Jul 12: πŸ₯³ (5)

Step 2 β€” Draw the mood lineΒΆ

InΒ [4]:
import matplotlib.pyplot as plt

labels = [d.strftime("%a") for d in days]
fig, ax = plt.subplots(figsize=(8, 4))
ax.plot(labels, points, marker="o", linewidth=2.5, color="#111111")
ax.fill_between(labels, points, alpha=0.12, color="#8b1e1e")
ax.set_ylim(0, 5.5)
ax.set_title("Emoji Mood Tracker β€” CodeItAll")
ax.set_ylabel("Mood score")
fig.tight_layout()
out = OUTPUT_DIR / "mood_tracker.png"
fig.savefig(out, dpi=140)
plt.show()
(OUTPUT_DIR / "mood_log.txt").write_text(
    "\n".join(f"{d}|{m}|{p}" for d, m, p in zip(days, MOOD_LOG, points)),
    encoding="utf-8",
)
print(f"Saved {out}")
No description has been provided for this image
Saved outputs\emoji_mood_tracker\mood_tracker.png

βœ… Project completeΒΆ

Check your output folder: outputs/emoji_mood_tracker/

Next: Project 25: Unit Converter Booth Β· Index