Skip to main content

Trainer — CLI Exercise Trainer

Trainer is a command-line exercise training tool to manage, run and validate programming exercises. It supports importing repositories, installing exercises into a working directory, running an interactive sandboxed session, and validating solutions.

Installation

Install the package in editable/development mode:

pip install -e .

This will install the package and its runtime dependencies (for example PyYAML). After installation the trainer command (the CLI) is available.

Available Commands

The CLI supports the following subcommands (see trainer <cmd> -h for full options):

  • import <git-url> — Import an exercises repository into the local trainer base directory.

    • Options: --base-dir (default: ~/.trainer)
  • ls — List exercises available in the base directory.

    • Options: --base-dir, --tag, -d/--done (show already completed), -r/--repo (filter by repository name)
  • install <exs> — Install an exercise into a (usually empty) target directory.

    • Options: --base-dir (where exercises are stored), --user-dir
  • exec <exs> — Create a temporary working directory for the exercise, install it there and launch an interactive shell (with timer support).

    • Options: --base-dir
  • check — Run the exercise validation command defined in the exercise config.yml in the current or provided directory.

    • Options: --base-dir, --user-dir
  • update — Pull updates for repositories in the base directory (uses git).

    • Options: --base-dir, --repo (optional specific repo)
  • stats — Show history statistics (done/failed exercises).

    • Options: --filter
  • recommend <reference_alias> — Recommend similar exercises based on tags and difficulty.

    • Options: --base-dir, --top-k, --include-done, --allow-lower-difficulty, --min-common-tags

Note: some internal code paths reference a time action for reporting timer state, but time is not defined as a top-level subcommand in the CLI argument parser. Use check and the timer mechanisms that run with exec and install workflows.

Typical workflow

  1. Import repositories that contain exercises:
trainer import https://github.com/your-org/exercises.git
  1. List available exercises:
trainer ls --base-dir ~/.trainer
  1. Run an exercise in a sandboxed shell (creates a temporary working directory):
trainer exec min_1
  1. Work on the exercise in the interactive shell and then validate the solution from within the working directory (or from your user dir):
trainer check --user-dir /path/to/your/workdir
  1. Optionally install an exercise into a user directory (useful for sharing or persistent workspaces):
trainer install min_1 --user-dir ~/workspace/min_1

Configuration

Exercises may include a config.yml with fields such as commands, timeout, tags, and description. The check command runs the commands.validate command (if defined) from the merged configuration (repository config.yml + exercise config.yml).

The trainer stores an index file .trainer_index.yml in the base directory (default ~/.trainer) and history in ~/.trainer/history.yml.

Help

General help:

trainer -h

Help for a specific command, e.g.:

trainer import -h
trainer ls -h
trainer install -h
trainer exec -h
trainer check -h

Repository

Source repository :

https://github.com/RomainGueninchault/pfa_systeme

Metadata

Release files for code-trainer 1.0.0

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

Source distribution (sdist)

Source distribution for code-trainer 1.0.0
File Size Uploaded Provenance Actions
code_trainer-1.0.0.tar.gz 19.2 kB With provenance Details for code_trainer-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for code-trainer 1.0.0
File Interpreter ABI Platform Actions
code_trainer-1.0.0-py3-none-any.whl Python 3 none any Details for code_trainer-1.0.0-py3-none-any.whl

Total release size: 43.8 kB

Release files / code_trainer-1.0.0.tar.gz

Download URL code_trainer-1.0.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8fbd0dc4dfe94601fb67cbe541fd9fd0ba1704f2ee07d2c0fb62139913b47396
BLAKE2b-256 checksum
How to use checksums
ffbc331d1b853dfef6b0c44c3d65539db14c1c29171f8baaf0a1c659a686edbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release files / code_trainer-1.0.0-py3-none-any.whl

Download URL code_trainer-1.0.0-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e4693d84507898be4293e330129d5b2b8c7f6524f388ea97c3f98d4e2f9575c
BLAKE2b-256 checksum
How to use checksums
5e06e56bb8395521a225ff480fc77c4bd8c5056e007a8b17e16ecedae20b64db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Security for code-trainer 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for code_trainer-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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