Skip to main content

Gepetuto

PyPI version pre-commit.ci status Tests Release

Ruff uv

Tutorial edition framework

This project contains some tools to help authoring and maintaing python tutorials presented on notebooks.

Install

Add gepetuto in your pip / PyPI dependencies

Usage

  1. create a (eg. tp1) directory (tp0 can be used to check prerequisites)
  2. write python scripts (eg. example_script.py) in this directory
  3. delimit snippets inside those scripts between # %jupyter_snippet example_snippet and # %end_jupyter_snippet
  4. create a (eg. 1-example_notebook.ipynb) notebook, containing import gepetuto.magic
  5. run gepetuto -a generate: this will create a tp{i}/generated directory with eg. example_script_example_snippet
  6. cells can contain either eg. %load tp1/generated/example_script_example_snippet to display some code to students, or their %do_not_load version to let the student write the code themself
  7. run gepetuto -a test to check all python scripts in tp directories
  8. run gepetuto -a lint to ensure the coding standards are respected in all python scripts in tp directories
  9. add gepetuto -a test in your CI, and gepetuto -a lint + gepetuto -a generate in your pre-commit

Command line

$ gepetuto -h
usage: gepetuto [-h] [-q] [-v] [-a [{lint,test,generate,all}]] [-f [FILE ...]] [-F [FILTER ...]]
                [-p PYTHON] [-c] [-C DIRECTORY] [--version] [tp_id ...]

Tutorial edition framework

positional arguments:
  tp_id                 choose which tp to process. Default to all.

options:
  -h, --help            show this help message and exit
  -q, --quiet           decrement verbosity level
  -v, --verbose         increment verbosity level
  -a, --action [{lint,test,generate,all}]
                        choose what to do. Default to 'generate'.
  -f, --file [FILE ...]
                        choose which files to process.
  -F, --filter [FILTER ...]
                        filter files to process.
  -p, --python PYTHON   choose python interpreter to use.
  -c, --check           check if linters change files.
  -C, --directory DIRECTORY
                        choose directory to run action on.
  --version             Get gepetuto version.

CI Example

example of CI using all gepetuto actions on tests folder here :

Pre commit example

- repo: https://github.com/Gepetto/gepetuto
  rev: v2.0.3
  hooks:
  - id: generate-action
  - id: lint-action
  - id: test-action

Examples

Metadata

Release files for gepetuto 2.0.3

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

Source distribution (sdist)

Source distribution for gepetuto 2.0.3
File Size Uploaded
gepetuto-2.0.3.tar.gz 83.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gepetuto 2.0.3
File Interpreter ABI Platform
gepetuto-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 92.3 kB

Release files / gepetuto-2.0.3.tar.gz

Download URL gepetuto-2.0.3.tar.gz
Size 83.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f0d4c8082467c1912f74658b48ef48f0af742318ae0ab28c6c39822d66cebe50
BLAKE2b-256 checksum
How to use checksums
cd040fd02b9f3a0c56e55d3a4ae782241b1a8e61324c981db9c40d83217b3f5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 2, 2025.

Transparency log

Release files / gepetuto-2.0.3-py3-none-any.whl

Download URL gepetuto-2.0.3-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dce5ed4da305aad65149296d9379b462ac6187fc260dfbd7f29927de3ce9c427
BLAKE2b-256 checksum
How to use checksums
4bfb70d71ac626ae4cf5bae070c7752d648c36790282337d4905a7b7a04b5873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 2, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.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