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-0.0.6.tar.gz (18.3 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-0.0.6-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for code_trainer-0.0.6.tar.gz
Algorithm Hash digest
SHA256 2575f3f2d92e114460159a87c7afc984b388f9eef2ad5f36e1880c5ff8ed68e6
MD5 4fb58008bcfaafe243f39e1059e6ef7b
BLAKE2b-256 db800e1164967476d4cfca7259de2a84cc439694a8a4923f620d8397cb62596b

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_trainer-0.0.6.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-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: code_trainer-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 23.2 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-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 65fca4c7c1c9bcb003a1120c3044bb18cb97349afa21ae0faca6a9aefff9e79b
MD5 7e12a5ccf9a1dc0ed4cf44e6d613af44
BLAKE2b-256 3d3cf8161bccb5b43a8102dd3e16abe31df53bc124cc8b07624294408e1ff600

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_trainer-0.0.6-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