Skip to main content

Console touch-typing trainer with gamification

Project description

typehero

A console touch-typing trainer with gamification — think "Соло на клавиатуре" in your terminal. Work through a course of linearly-unlocked lessons, each gated on typing speed and error rate, and earn XP, levels, achievements, streaks, and combos along the way.

The trainer ships with full English and Russian courses; the typing language (a course property) and the UI language (a profile setting) are independent.

Install & run

The project is managed with uv.

uv sync            # create .venv and install runtime + dev dependencies
uv run typehero    # launch the TUI (equivalent to `python -m typehero`)

Your profile is stored as JSON under $XDG_CONFIG_HOME (falling back to the platform default). A corrupt profile is backed up rather than deleted, then replaced with a fresh one.

Development

uv run pytest                  # run all tests (-q is configured by default)
uv run pytest -k streak        # tests matching a keyword
uv run ruff check              # lint (E, F, I, UP, B, SIM)
uv run ruff format             # format (100-char lines)
uv run ty check                # static type check

Property-based tests use hypothesis; its database lives in .hypothesis/.

Architecture

Dependencies flow one direction: tui → gamification → domain → engine. The inner layers never import outer ones, know nothing about the terminal, and take time as injected data — so the whole core is deterministic and unit-testable without a TUI.

Layer Responsibility
engine/ Pure typing logic — keystrokes, session state, derived metrics. No I/O, no clock.
domain/ Lessons, pass criteria, results, course unlocking, saved progress, generators.
gamification/ XP curve, declarative achievements, calendar-day streaks, combo tracking.
persistence/ Atomic JSON profile save (temp file + os.replace).
tui/ The Textual layer — app, screens, widgets.

A key convention: time and other ambient state are injected (timestamp, today), never read from a clock inside the core. See CLAUDE.md for the full set of codebase conventions.

Course, achievement, and i18n YAML lives under src/typehero/content/ and ships inside the wheel.

Releases

This repository uses Conventional Commits and automated releases:

  • CI (.github/workflows/ci.yml) runs ruff check, ruff format --check, ty check, and pytest on every pull request and on pushes to main.
  • release-please (.github/workflows/release-please.yml) reads feat: / fix: commits on main, opens a release pull request that bumps the version in pyproject.toml and updates CHANGELOG.md, and tags a GitHub Release when that pull request is merged.
  • Publish (.github/workflows/publish.yml) runs when a GitHub Release is published, builds the wheel and sdist with uv build, and uploads them to PyPI via Trusted Publishing (OIDC) — no API token is stored. The job runs in the pypi environment.
  • Dependabot (.github/dependabot.yml) proposes weekly, grouped minor/patch updates for Python dependencies (uv) and GitHub Actions, with a 7-day cooldown. Major bumps are not opened automatically.

Commit type → changelog section: feat (Features), fix (Bug Fixes), perf (Performance), refactor (Refactoring), docs (Documentation).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typehero-0.1.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typehero-0.1.0-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

Details for the file typehero-0.1.0.tar.gz.

File metadata

  • Download URL: typehero-0.1.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for typehero-0.1.0.tar.gz
Algorithm Hash digest
SHA256 950d78b29b72ba89b4f59d12faea87e375a5c883e98ff2d5c04e1724cc655b5b
MD5 ff6bb846490188e954cd8b2b5cac6138
BLAKE2b-256 c545487dbe057c3f55c52def3430aea652b5e1a86b09da8f6bc3a675dcc8d0c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for typehero-0.1.0.tar.gz:

Publisher: publish.yml on agolosnichenko/typehero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file typehero-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: typehero-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for typehero-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7da0a079ad2e6254186f09aeaee4ee7243f8eb97eedf6aa8c90f357193765c1
MD5 62f7f32afdb48cf041e0adbc87d72f3f
BLAKE2b-256 b33ccf2f6d84ddb700b0e3e68f293a59b1b8e6f0f06d00d040c27d5a19ceeb67

See more details on using hashes here.

Provenance

The following attestation bundles were made for typehero-0.1.0-py3-none-any.whl:

Publisher: publish.yml on agolosnichenko/typehero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page