Python learnings, Rustlings-style, in a terminal TUI.
Project description
Pythonlings
Documentation: pythonlings.abhik.ai
Rustlings for Python — learn by fixing 292 tiny broken programs in your terminal.
Pythonlings helps you learn Python by fixing small broken programs and watching checks rerun as you type. It is built for beginner Python practice, coding practice, and self-paced Python tutorial workflows: 292 exercises, hidden pytest-style checks, a live Textual editor, progressive hints, and bundled Python documentation snippets so learners can work without leaving the terminal.
Try it in 10 seconds — zero install, needs Python 3.9+ and uv:
uvx pythonlings init --path ./learn-python
cd learn-python && uvx pythonlings
How it works: edit the broken exercise in the built-in editor → checks rerun as you type and advance you to the next one. That's the whole loop.
Status: v0.3.0, alpha — published on PyPI as pythonlings.
Highlights
- 292 Python exercises across 31 topics, from variables through async.
- Rustlings-inspired learn-by-doing flow for Python coding practice.
- Live in-terminal editor with automatic checks after edits.
- Topic picker with progress, resume state, reset, hints, and one-shot CLI runs.
F5opens a local Python reference window;Oopens the official docs page.- Bundled docs are generated from the official Python documentation for offline use.
Who It Is For
- Python beginners who want short, focused practice instead of passive reading.
- Rustlings users who want the same fix-and-verify loop for Python.
- Learners who prefer working in a terminal with local docs close to the code.
- Contributors interested in building curriculum, checks, and terminal UX.
What Happens When You Run It
pythonlings initcreates a self-contained learner workspace with exercises, hidden checks, local docs, and original snapshots for reset.pythonlingsopens the first pending exercise in the terminal UI.- You edit the broken code, remove
# I AM NOT DONE, and checks rerun as you work. - Passing checks mark the exercise complete and move progress forward.
F4opens the topic picker,F5opens local docs, andEscquits main screens.
Install
Pythonlings is on PyPI as pythonlings (it installs the pythonlings
command). You need Python 3.9+.
Recommended — install it isolated, like any CLI app:
pipx install pythonlings
# or
uv tool install pythonlings
Or run it with no install at all:
uvx pythonlings
Or plain pip (use a virtual environment):
pip install pythonlings
Pythonlings was previously published as
python-learnings. The packagepylingson PyPI is an unrelated project — installpythonlings.
For the latest development build from main:
pipx install --force "git+https://github.com/abhiksark/pythonlings.git"
Create a learner workspace before starting:
pythonlings init --path ~/pythonlings-workspace
cd ~/pythonlings-workspace
pythonlings
For local development:
git clone git@github.com:abhiksark/pythonlings.git
cd pythonlings
pip install -e ".[dev]"
Quick Start
pythonlings init --path ./learn-python # create a self-contained workspace
cd learn-python
pythonlings # open the TUI on the first pending exercise
pythonlings topics # open the topic picker
pythonlings list # show topic progress
pythonlings hint variables1 # print a hint and docs link
pythonlings run variables1 # run one exercise check
pythonlings dry-run variables1 # run one exercise non-interactively
pythonlings reset variables1 --yes # restore an exercise from its original
pythonlings update # refresh checks/docs after upgrading pythonlings
Each exercise contains a # I AM NOT DONE marker. Fix the code, remove the
marker, and let the live check advance you to the next exercise.
Demo
The demo is generated from docs/demo.tape. See docs/DEMO_GIF.md to regenerate it with VHS. It covers the first-run flow, progress listing, hints, the coding screen, local docs, topic picker, and quit path.
Interface
| Key | Action |
|---|---|
F1 |
Toggle hint |
F2 |
Reset the current exercise |
F3 |
Toggle the exercise list |
F4 |
Return to the topic picker |
F5 |
Show the local Python reference |
O |
Open official docs from the reference window |
Esc |
Close docs, or quit from main screens |
Ctrl+Q |
Quit |
Project Layout
pythonlings/ # application package
core/ # manifest, state, runner, reset, docs loading
screens/ # Textual screens
widgets/ # reusable TUI widgets
docs/ # bundled Python documentation snippets
pythonlings/curriculum/ # packaged copy in built wheels
exercises/<topic>/ # learner-editable exercise files
checks/<topic>/ # hidden assertions for each exercise
tests/ # unit, integration, and TUI tests
scripts/fetch_python_docs.py
info.toml # curriculum order, hints, and docs URLs
Regenerate the local reference snippets with:
python scripts/fetch_python_docs.py
Development
pip install -e ".[dev]"
python -m pytest -q
pythonlings --root tests/fixtures/passing_curriculum verify
When adding curriculum, update exercises/, checks/, and info.toml
together. Keep exercise and check filenames mirrored, for example
exercises/lists/lists3.py and checks/lists/lists3.py.
Contributing
Pythonlings is actively developed and welcomes contributors — beginners included.
The current focus is the 0.3.0 roadmap (wider adoption),
and every roadmap issue is written to be picked up cold. Start with a
good first issue,
comment to claim it, and see CONTRIBUTING.md.
Release Flow
Pythonlings uses Semantic Versioning:
MAJOR: incompatible curriculum or CLI changes.MINOR: new topics, exercises, TUI features, or docs workflows.PATCH: fixes, copy edits, and compatible test or packaging updates.
Branch flow is feature-first:
feature/<name> -> dev -> main -> vMAJOR.MINOR.PATCH
Feature branches are merged into dev. A verified dev branch is then merged
into main and tagged with an annotated release tag such as v0.1.0.
See RELEASE.md for the release checklist.
Attribution
Pythonlings is inspired by rustlings. Bundled reference snippets are generated from the official Python documentation. See pythonlings/docs/NOTICE.md for Python documentation licensing details.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythonlings-0.3.0.tar.gz.
File metadata
- Download URL: pythonlings-0.3.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beb29812f4ea166a778a1ded832165b891196cfb61f00111454ab2553542acc3
|
|
| MD5 |
cae452aad8c82db2f0927b8b4106e0db
|
|
| BLAKE2b-256 |
0c1908f23c058aeebf5ed03481d7ca0011e16500fdc0519e32b23388be4624c5
|
Provenance
The following attestation bundles were made for pythonlings-0.3.0.tar.gz:
Publisher:
publish.yml on abhiksark/pythonlings
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythonlings-0.3.0.tar.gz -
Subject digest:
beb29812f4ea166a778a1ded832165b891196cfb61f00111454ab2553542acc3 - Sigstore transparency entry: 1860536568
- Sigstore integration time:
-
Permalink:
abhiksark/pythonlings@10e6bb007950f1425d9a5c30cc8386f5314e1edc -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/abhiksark
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@10e6bb007950f1425d9a5c30cc8386f5314e1edc -
Trigger Event:
release
-
Statement type:
File details
Details for the file pythonlings-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pythonlings-0.3.0-py3-none-any.whl
- Upload date:
- Size: 414.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b5cae0e5712902e4d7fdeb9aec3b7e6f373d2e184d2f3f6518d89165a12361d
|
|
| MD5 |
7414d30f0cbc188b5d1ae01268cde6b4
|
|
| BLAKE2b-256 |
d44cf8d0acaa1147081d871df7b1768aac4e53e49777e0a59d964597081f4e03
|
Provenance
The following attestation bundles were made for pythonlings-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on abhiksark/pythonlings
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythonlings-0.3.0-py3-none-any.whl -
Subject digest:
5b5cae0e5712902e4d7fdeb9aec3b7e6f373d2e184d2f3f6518d89165a12361d - Sigstore transparency entry: 1860536695
- Sigstore integration time:
-
Permalink:
abhiksark/pythonlings@10e6bb007950f1425d9a5c30cc8386f5314e1edc -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/abhiksark
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@10e6bb007950f1425d9a5c30cc8386f5314e1edc -
Trigger Event:
release
-
Statement type: