Skip to main content

Tutorial edition framework

Project description

Gepetuto

PyPI version pre-commit.ci status Tests Release Code style: black Ruff

Tutorial edition framework

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

Install

You are strongly encouraged to use a virtual env or similar.

python -m pip install gepetuto

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

CI Example

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

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.2.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

gepetuto-1.2.0-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page