Strongly Typed is a touch-typing game that turns real Python modules into short practice rounds. Pick a library from PyPI, let the game install or find it, choose one of its modules, and type actual Python syntax with live finger guidance.
- Accepts any plain PyPI distribution name, such as
pandas,requests, orrich. - Detects libraries that are already installed and otherwise installs them with the same Python interpreter that runs the game.
- Discovers source through package metadata instead of importing unknown libraries.
- Builds a compact lesson from short, syntax-rich lines in a real module.
- Shows the next key, recommended finger, opposite-hand Shift guidance, WPM, accuracy, mistakes, streak, score, and progress.
- Includes an offline demo, so the first round never depends on a network.
Python 3.10 or newer is required.
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .
strongly-typedpython3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
strongly-typedYou can also launch it with python -m strongly_typed.
| Screen | Control | Action |
|---|---|---|
| Library | Type + Enter | Install/find a package |
| Module list | Up/Down or mouse | Select a module |
| Module list | Enter | Start a round |
| Game | Type | Copy the highlighted source line |
| Game | Backspace | Correct the last character |
| Game | Tab | Enter up to four expected indentation spaces |
| Game | Esc | Leave the current round |
| Results | R | Replay the same module |
| Results | M | Return to module selection |
| Results | N | Choose a new library |
Correct lines advance automatically. Spaces are shown as middle dots so indentation is visible; you still type normal spaces.
Only install packages you trust. PyPI packages can run code as part of their installation. Strongly Typed reduces extra exposure in two ways:
- It accepts only a plain distribution name, never arbitrary pip flags or version expressions.
- It reads installed
.pyfiles from distribution metadata and does not import a chosen library merely to build lessons.
This does not make an untrusted package safe to install. A virtual environment keeps the student's project dependencies isolated and is strongly recommended.
src/strongly_typed/
├── app.py Pygame screens, events, and asynchronous loading
├── core.py Typing rules, metrics, and finger guidance
├── lessons.py Real-source to lesson selection
├── packages.py PyPI installation and source discovery
├── demo_lesson.py Offline first-run lesson
└── __main__.py CLI and screenshot helper
tests/ Unit and integration-oriented tests
docs/ PRD, user stories, architecture, and images
The game rules deliberately do not import Pygame. That makes the interesting logic easy to test before touching rendering code.
Install the developer extras, run the tests, and make a screenshot:
python -m pip install -e ".[dev]"
python -m pytest
python -m strongly_typed --screenshot artifacts\game.png --screen gameAvailable preview screens are home, modules, game, and
results. The screenshot command uses SDL's headless driver, so it also
works in continuous integration.
Good student-sized extensions include difficulty levels, lesson history, personal best persistence, sound effects, alternate keyboard layouts, or a module search box. Read the architecture guide before starting a larger change.
- Packages need readable Python source. Compiled-only libraries cannot become lessons.
- Extremely large files, tests, vendored code, migrations, and generated metadata are omitted to keep module selection useful.
- Non-ASCII and very long lines are skipped because they are poor practice prompts on a standard keyboard.
- A package install needs network access unless that package is already installed.
Strongly Typed is shared under the MIT License.

