Building QM2: A Modern, Dockerized CLI Quiz Engine with 330+ Tests
Source: Dev.to
🚀 The Mission
Most quiz applications are web‑based, but I wanted something that lives where I spend most of my time: the terminal. I built QM2 — a robust, interactive quiz engine designed for developers and power users who value speed, efficiency, and a clean “brutalist” UI.
🛠️ The Tech Stack
To make a CLI feel like a professional product, I relied on some of the best libraries in the Python ecosystem:
- Rich – beautiful, colored interface and real‑time feedback.
- Questionary – handles complex interactive prompts and menus.
- Platformdirs – ensures data is stored correctly on Windows, macOS, or Linux.
- Docker – for running the engine in a completely isolated environment.

🏗️ Engineered for Reliability
As a developer, I believe that if it’s not tested, it’s broken.
- 330 Individual Tests – ensuring the core logic remains rock‑solid as the project grows.
- 86 % Coverage – backed by a strict CI/CD pipeline.
- OIDC Publishing – secure, token‑less deployment to PyPI via GitHub Actions.

✨ Key Features
- 4 Question Types – Multiple Choice, True/False, Fill‑in‑the‑blank, and Matching.
- Flashcards Mode – stress‑free learning without the pressure of a timer.
- Data Portability – bidirectional CSV ↔ JSON conversion; import quizzes directly from a URL.
- Category Management – organize learning into hierarchical structures (e.g.,
programming/python/basics).

📦 Installation & Quick Start
# Install from PyPI
pip install qm2
# Run the CLI
qm2
Or use Docker to keep your system clean:
docker build -t qm2 .
docker run -it -v qm2_data:/root/.local/share/qm2 qm2
📖 Deep Dive into Data
The question format is designed to be human‑readable. QM2 supports both JSON (precise) and CSV (bulk editing) representations.
{
"type": "match",
"question": "Match programming languages with their types",
"pairs": {
"left": ["Python", "C++"],
"right": ["Interpreted", "Compiled"],
"answers": { "a": "1", "b": "2" }
}
}
🗺️ What’s Next?
“With the release of v1.0.25, QM2 has officially moved out of beta. The core is now stable, and I am shifting focus towards expanding the ecosystem.”
- AI Integration – generate quizzes automatically from your documentation.
- Plugin System – allow the community to build their own extensions.
🔗 Links & Support
- PyPI:
- GitHub:
- Docs:
Feel free to share your favorite library for building CLI tools in Python in the comments!