Gepetuto
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
- create a (eg.
tp1) directory (tp0can be used to check prerequisites) - write python scripts (eg.
example_script.py) in this directory - delimit snippets inside those scripts between
# %jupyter_snippet example_snippetand# %end_jupyter_snippet - create a (eg.
1-example_notebook.ipynb) notebook, containingimport gepetuto.magic - run
gepetuto -a generate: this will create atp{i}/generateddirectory with eg.example_script_example_snippet - cells can contain either eg.
%load tp1/generated/example_script_example_snippetto display some code to students, or their%do_not_loadversion to let the student write the code themself - run
gepetuto -a testto check all python scripts in tp directories - run
gepetuto -a lintto ensure the coding standards are respected in all python scripts in tp directories - add
gepetuto -a testin your CI, andgepetuto -a lint+gepetuto -a generatein 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)
| File | Size | Uploaded | |
|---|---|---|---|
| gepetuto-2.0.3.tar.gz | 83.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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