Skip to main content

examshell-python

Interactive terminal shell for practising 42-style Python exam tasks. Simulates the real exam environment — timed pressure, blind grading, sequential levels — or lets you work through exercises freely in practice mode.

Features

  • Two modes — Real (exam simulation) and Practice (free training)
  • Automatic grading — grademe runs your solution against test cases and shows a results table
  • Multi-language task descriptions — each task is described in EN, DE, FR, ES, IT
  • 14 tasks across 6 levels — from easy warm-ups to hard algorithmic challenges
  • Clean terminal UI — built with Rich

Installation

Requires Python 3.10+.

pip install examshell-python

Or install from source:

git clone <repo-url>
cd examshell-python
pip install .

Usage

examshell42

On launch you choose an available exam rank, then a mode. In the mode menu, choose b to return to rank selection:

╭─ Choose your Exam mode ─╮
│ Real mode       (1)     │
│ Practice mode   (2)     │
│ Best solutions  (3)     │
│ Back to rank    (b)     │
╰─────────────────────────╯

At startup, examshell attempts to refresh ranks 03, 04, and 05 from the exam sites and saves valid task data as rank*.json. If an update fails, existing local task files remain available and the application continues offline.

Real mode

Simulates the actual exam. Tasks are drawn randomly per level. Progress is distributed across the available levels; completing the final level reaches 100.

Command Description
grademe Check your solution
status Show current task info again
finish End the exam

Practice mode

Work through all tasks in any order, retry freely, no score pressure.

Command Description
grademe Check your solution
list Show all available tasks
choose Pick a task by number
skip Move to the next task
status Show current task info again
finish End the practice session

Best solutions

Downloads available reference solutions into the session's solutions/ folder without running them or overwriting existing files. The public source repository uses rankN/<task-name>/<task-file> paths; missing solutions are reported in the results table.

How it works

When a session starts, examshell creates a working directory (exam42/) with two sub-folders:

exam42/
├── subjects/
│   └── <task_name>/
│       ├── <task_name>.en.txt   ← task description + signature + examples
│       ├── <task_name>.de.txt
│       └── ...
└── rendu/
    └── <task_name>/
        └── <task_name>.py       ← put your solution here

Write your solution in rendu/<task_name>/<task_name>.py, then run grademe. The shell imports your file, executes each example against it, and prints a pass/fail table.

Tasks

Level Difficulty Task
1 Easy py_bracket_validator — validate bracket pairs ()[]{}
1 Easy py_cryptic_sorter — custom sort logic
2 Easy py_echo_validator — string validation
2 Easy py_mirror_matrix — matrix mirroring
3 Medium py_hidenp — hidden number problem
3 Medium py_inter — intersection of sequences
3 Medium py_number_base_converter — base conversion
3 Medium py_pattern_tracker — pattern detection
4 Medium py_anagram — anagram check
4 Medium py_shadow_merge — merge operations
4 Medium py_string_permutation_checker — permutation check
5 Hard py_string_sculptor — string transformation
5 Hard py_twist_sequence — sequence manipulation
6 Hard py_whisper_cipher — cipher encoding

Dependencies

  • pyjsparser ≥ 2.7.1 — parse downloaded task data
  • pydantic ≥ 2.0 — task data models
  • rich ≥ 13.0 — terminal UI
  • requests ≥ 2.0 — download task data

Project structure

src/examshell/
├── __init__.py
├── __main__.py
├── main.py           # CLI entry point, mode logic, UI screens
├── models.py         # Pydantic models (Task, Description, Example)
├── task_generator.py # TaskManager: file creation, grading, task selection
├── config.py
└── data/
    └── data.json     # All task definitions

License

MIT

Metadata

Release files for examshell-python 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for examshell-python 0.1.11
File Size Uploaded
examshell_python-0.1.11.tar.gz 52.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for examshell-python 0.1.11
File Interpreter ABI Platform
examshell_python-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size: 106.8 kB

Release files / examshell_python-0.1.11.tar.gz

Download URL examshell_python-0.1.11.tar.gz
Size 52.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3c93cda93f76f9611b378fba5dbde383cc97152d51387256b18ed610d10b099d
BLAKE2b-256 checksum
How to use checksums
4318dc8dc23ac67549e2d6117aab3e89ef0897f156f03a3c3e7deb7fd8179d6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / examshell_python-0.1.11-py3-none-any.whl

Download URL examshell_python-0.1.11-py3-none-any.whl
Size 54.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d0a157e4b16cf12bd49825f7f6ae1a9d3eac9cb2c8d6cec0c2d6957f650649f
BLAKE2b-256 checksum
How to use checksums
42f3e05866567a1a93501c63045ca97c27e3880f28dbd57ace6c9c785c8e43cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.12

2 release files

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page