Skip to content

About

A touch-typing game that teaches Python syntax with real source from PyPI packages.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Strongly Typed

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.

Strongly Typed gameplay

What the game does

  • Accepts any plain PyPI distribution name, such as pandas, requests, or rich.
  • 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.

Strongly Typed library picker

Quick start

Python 3.10 or newer is required.

Windows PowerShell

py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .
strongly-typed

macOS or Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
strongly-typed

You can also launch it with python -m strongly_typed.

Controls

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.

Package safety

Only install packages you trust. PyPI packages can run code as part of their installation. Strongly Typed reduces extra exposure in two ways:

  1. It accepts only a plain distribution name, never arbitrary pip flags or version expressions.
  2. It reads installed .py files 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.

Project tour

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.

Development

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 game

Available 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.

Limits worth knowing

  • 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.

About

A touch-typing game that teaches Python syntax with real source from PyPI packages.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages