← Back to Python series
🛠
Practice Projects · ★★★
File I/O · Encryption · Search · Markdown

Project 11 — Diary App

Write encrypted daily journal entries, search past entries by keyword or date, and export to Markdown.

file I/Oencryptiondiarysearchmarkdown
Duration
2.5 hours
Level
📊 Intermediate-Advanced Applied
Prerequisite
🎯 Intermediate Week 6
OUTCOME
An encrypted diary app with keyword search and Markdown export

What you'll learn

  • 1Store entries as individual .txt files with date filenames
  • 2Encrypt entries with a simple XOR cipher (or Fernet from cryptography)
  • 3Search all entries for a keyword
  • 4Export selected entries to a single Markdown file

Entry Format

text
# 2024-05-15
Mood: 😊
Weather: Sunny

Today I started a new Python project. The weather was great,
and I managed to finish the basic structure in a few hours...

Commands

  • write [date] — open editor for today's entry (or specified date)
  • read [date] — display entry for a date
  • search <keyword> — find all entries containing keyword
  • export [from] [to] — export date range to diary.md
  • stats — word count, mood distribution, writing streak

📝 Exercises

Try them yourself first, then open the solution to compare.

Exercise 1

Build the diary app

Goal: Implement write, read, search, and export with optional encryption.

Requirements
  • Date-based file naming
  • read/write commands
  • Keyword search across all entries
  • Markdown export
Example code / lecture materials

All lecture materials and example code are openly available on GitHub.

View on GitHub ↗