Tutorial edition framework
Project description
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 (tp0
can be used to check prerequisites) - write python scripts (eg.
example_script.py
) in this directory - delimit snippets inside those scripts between
# %jupyter_snippet example_snippet
and# %end_jupyter_snippet
- create a (eg.
1-example_notebook.ipynb
) notebook, containingimport gepetuto.magic
- run
gepetuto -a generate
: this will create atp{i}/generated
directory with eg.example_script_example_snippet
- 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 - run
gepetuto -a test
to check all python scripts in tp directories - run
gepetuto -a lint
to ensure the coding standards are respected in all python scripts in tp directories - add
gepetuto -a test
in your CI, andgepetuto -a lint
+gepetuto -a generate
in your pre-commit
Command line
$ gepetuto -h
usage: gepetuto [-h] [-v] [-a [{lint,test,generate,all}]] [-f [FILE [FILE ...]]] [-F [FILTER [FILTER ...]]]
[-p PYTHON] [-c] [-C DIRECTORY] [--version] [tp_id [tp_id ...]]
Tutorial edition framework
positional arguments:
tp_id choose which tp to process. Default to all.
optional arguments:
-h, --help show this help message and exit
-v, --verbose increment verbosity level
-a [{lint,test,generate,all}], --action [{lint,test,generate,all}]
choose what to do. Default to 'generate'.
-f [FILE [FILE ...]], --file [FILE [FILE ...]]
choose which files to process.
-F [FILTER [FILTER ...]], --filter [FILTER [FILTER ...]]
filter files to process.
-p PYTHON, --python PYTHON
choose python interpreter to use.
-c, --check check if linters change files.
-C DIRECTORY, --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: v1.3.0
hooks:
- id: generate-action
- id: lint-action
- id: test-action
Examples
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
gepetuto-1.3.0.tar.gz
(8.1 kB
view details)
Built Distribution
File details
Details for the file gepetuto-1.3.0.tar.gz
.
File metadata
- Download URL: gepetuto-1.3.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 599936116bec319897a4042c487a121747de2f944356f0c3c3c9c4a6e0af70ac |
|
MD5 | ad969ccc41ffcfce42eee5eee88b3354 |
|
BLAKE2b-256 | a5133f4a083486810d5677c52c37bb9e82c5d2d0e35407133febcbb18b5b8622 |
File details
Details for the file gepetuto-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: gepetuto-1.3.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db5b9024d36a29f4cbff67e443d749eda7678ed9f62b3d098e338d065c1def26 |
|
MD5 | 305a9c07e0fbcc474b4d21d34eacd15f |
|
BLAKE2b-256 | 5930f0946bf3aca88f7a7945558a994be58e77cd2db6ee14f57a951777fb5cfd |