Skip to content

marchelloUA/memory_cards

Repository files navigation

Memory Cards

A minimalistic memory card app written in Python 3.12

Features

  • Language pairs: select at launch (default german-english).
  • Input: use dictionary.json (list of {"german","english"} objects).
  • Controls: Arrow Left = not remembered, Arrow Right = remembered. Alternate single-key substitutes can be set in .env (e.g. LEFT_KEY=a).
  • Stats (stats.jsonl): every hit appends a JSON line. Each line records either left_hits or right_hits as 1 (the other is 0).
  • Summary (stats_summary.json): written on a graceful exit (Ctrl+C or termination signals). On startup the app will use a valid stats_summary.json if present; otherwise it scans stats.jsonl to rebuild stats.
  • Daily counts: the app tracks daily swipe counts and stores them in the summary under daily. When the configured daily goal is reached the app prints a short notification.
  • Prioritization: unseen pairs are presented first. Left-swiped pairs are prioritized using LEFT_PRIORITY_FACTOR; remembered pairs are deprioritized according to REFRESH_FREQUENCY (all set in .env).
  • Configuration (.env): supported keys include REFRESH_FREQUENCY, RIGHT_HITS_THRESHOLD, DAILY_GOAL_SWIPES, LEFT_PRIORITY_FACTOR, LEFT_KEY, and RIGHT_KEY.
  • Exit: press Ctrl+C to exit; the app saves stats_summary.json on exit.
  • Display: text-only UI.

Usage

python memory_cards.py [language_pair]

Note: default language pair is german-english.

Setup

Create dictionary.json and .env from the provided samples, or supply your own. Example:

cp dictionary_sample.json dictionary.json
cp .env_sample .env
cp stats_sample.jsonl stats.jsonl

dictionary.json is required.

Gameplay

  1. The app displays one side of a random pair.
  2. Recall the translation in your head.
  3. Press Right Arrow if you remembered it, Left Arrow otherwise (substitute keys accepted).
  4. The app reveals the answer.
  5. Press an arrow again to confirm and continue.

Notes

  • Default configuration values: REFRESH_FREQUENCY=30, RIGHT_HITS_THRESHOLD=30, DAILY_GOAL_SWIPES=100, LEFT_PRIORITY_FACTOR=1.5.
  • dictionary.json accepts keys german/english or de/en.
  • Each round records the initial swipe and the confirmation swipe (two appended lines in stats.jsonl).
  • Each stats.jsonl line includes language_pair and last_seen timestamp.

Author

Marchello aka frz

About

learn foreign words using memory cards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages