Skip to main content

Systeme d'entrainement

Project description

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

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

code_trainer-1.0.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

code_trainer-1.0.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file code_trainer-1.0.0.tar.gz.

File metadata

  • Download URL: code_trainer-1.0.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for code_trainer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8fbd0dc4dfe94601fb67cbe541fd9fd0ba1704f2ee07d2c0fb62139913b47396
MD5 86a5d3201092cf6ea4a9ad90683a3097
BLAKE2b-256 ffbc331d1b853dfef6b0c44c3d65539db14c1c29171f8baaf0a1c659a686edbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_trainer-1.0.0.tar.gz:

Publisher: publish.yml on RomainGueninchault/pfa_systeme

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

File details

Details for the file code_trainer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: code_trainer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for code_trainer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e4693d84507898be4293e330129d5b2b8c7f6524f388ea97c3f98d4e2f9575c
MD5 a76f518a183ba36bbe2ee6b6af8761d0
BLAKE2b-256 5e06e56bb8395521a225ff480fc77c4bd8c5056e007a8b17e16ecedae20b64db

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_trainer-1.0.0-py3-none-any.whl:

Publisher: publish.yml on RomainGueninchault/pfa_systeme

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