{"id":15131193,"url":"https://github.com/jupyterphysscilab/jupyter-instructortools","last_synced_at":"2026-03-09T03:33:35.182Z","repository":{"id":44948042,"uuid":"248632989","full_name":"JupyterPhysSciLab/jupyter-instructortools","owner":"JupyterPhysSciLab","description":"Tools for making JupyterPhysSciLab notebook templates for student handouts","archived":false,"fork":false,"pushed_at":"2024-07-15T20:14:26.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T17:51:31.877Z","etag":null,"topics":["educational-software","educational-technology","jupyter","jupyter-notebook","pandas","plotting","python"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JupyterPhysSciLab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-20T00:24:46.000Z","updated_at":"2024-07-15T20:18:29.000Z","dependencies_parsed_at":"2024-06-25T15:12:34.764Z","dependency_job_id":"529cf19a-c67e-470d-a914-bf1298a4721f","html_url":"https://github.com/JupyterPhysSciLab/jupyter-instructortools","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"26d58d2a4ccc47ff866794614bb3e1ba1ff0f5c8"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupyterPhysSciLab%2Fjupyter-instructortools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupyterPhysSciLab%2Fjupyter-instructortools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupyterPhysSciLab%2Fjupyter-instructortools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupyterPhysSciLab%2Fjupyter-instructortools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JupyterPhysSciLab","download_url":"https://codeload.github.com/JupyterPhysSciLab/jupyter-instructortools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241984810,"owners_count":20052970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["educational-software","educational-technology","jupyter","jupyter-notebook","pandas","plotting","python"],"created_at":"2024-09-26T03:24:24.304Z","updated_at":"2026-03-09T03:33:35.149Z","avatar_url":"https://github.com/JupyterPhysSciLab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jupyter-instructortools\n[Introduction](#introduction) |\n[Usage](#usage) | \n[Current Menu Items](#available-menu-items) | \n[Typical workflow](#typical-workflow) | [Install](#install) | \n[Issues or Comments](#issues-or-comments) | \n[License](#this-software-is-distributed-under-the-gnu-v3-licensehttpsgnuorglicenses)\n## Introduction\nThis adds a menu to Jupyter that automates some useful tasks an\ninstructor might want to do while building a notebook template for an \nassignment. This is part of the\n[Jupyter Physical Science Lab project](https://jupyterphysscilab.github.io/Documentation/),\nbut can be used independently of the rest of the project.\n\n## Usage:\nThe menu that provides access to most of the tools is activated using the \n\"Activate menu\" item in the \"JPSL Instructor Tools\" section of the Jupyter \nLab command palette (figure 1). By default it is inactive at the beginning \nof a session.\n\n![Instructor Tool commands in Jupyter Lab command palette](https://raw.githubusercontent.com/JupyterPhysSciLab/jupyter-instructortools/master/JPSL_Instructor_Tools_palette_cmds.png)\n\n__Figure 1:__ Instructor Tool commands available in the Jupyter lab \ncommand \npalette.\n\nThe \"Disallow menu in Notebook\" option prevents the use of the Instructor \nTools menu with the _currently focused notebook_. This should only be done to \nthe final form of the notebook that will be distributed to students, because \nit is very difficult to reverse.\n\n### Available menu items\n* Create a data input table.\n    * Table column and row labels can be locked once set.\n    * Number of rows and columns must be chosen on initial creation.\n    * Table will survive deletion of all cell output data.\n    * The code cell that creates the table  is protected.\n    * Table creation code will work in a plain vanilla Jupyter install, but the \n      contents of the table cannot be edited.\n    * See the [jupyter-datainputtable](https://github.com/JupyterPhysSciLab/jupyter-datainputtable)\n      extension for more details.\n* Add some highlight bars to a selected markdown cell. These can be removed by \n  deleting the associated`\u003cdiv\u003e`:\n  * A vertical cyan bracket at the left of the cell.\n  * A vertical red bracket at the left of the cell.\n  * A horizontal green start bar (fading down to beige). Useful for indicating\n    the beginning of an instruction block.\n  * A horizontal brown stop bar (fading down from beige to brown). Useful \n    for indicating the end of an instruction block.\n* Protect/unprotect selected cells. Protected cells cannot be \n  edited or deleted by the user. This is a good way to prevent instructions\n  and example code from being damaged by students.\n* Set/un-set selected cells as allowed to be hidden. This can be used to mark\n  cells to hide before producing a pdf to turn in.\n* Set/un-set selected cells to collapse code before printing.\n* Set/un-set selected cells to collapse code in JPSL.\n* Temporarily highlight each kind of cell marked for hiding or code collapse.\n* Temporarily completely hide (not collapse) code (all or just selected cells).\n* Insert boilerplate instructions on initializing a\n  notebook into a selected markdown cell.\n* Insert boilerplate instructions on preparing a pdf version of the notebook \n  to turn in with instructor selected parts hidden.\n\n\u003c!-- Not part of menu or not working in current version.\n* Insert code to automatically timestamp the notebook and \n  collect names from students. The code is inserted at the end of the \n  currently selected cell. The cell becomes protected\n  against editing and deletion. This is a good cell to include initialization\n  imports in.\n--\u003e\n  \n### Typical workflow\nWork in a virtual environment that includes this tool plus all the tools\nthe students will have access to (see [Install](#install)).\n\n1. Start the jupyter notebook server (from the command line use `jupyter \n   lab` or `jupyter notebook`).\n1. Open a new notebook and activate the menu using the \"Activate menu\" item \n   in the \"JPSL Instructor Tools\" section of the Jupyter Lab command palette \n   (figure 1). By default it is inactive at the beginning of a session.\n1. Build the exercise including instructions, examples, tables (use the menu) \n   and imports.\n1. Collect all the necessary imports into a code cell that will be the \n   first code cell in the worksheet. You may want introductory material \n   before this cell.\n1. Use the menu to protect any cells you do not want students to \n   accidentally alter.\n1. Use the menu to tag cells so they can be hidden. This allows students to \n   print a compressed version of the notebook for grading. Consider hiding \n   most of the instructions.\n1. Restart the kernel and clear all cell outputs. Delete or emtpy any cells \n   that have things you want the students to be filling in.\n1. Save the notebook and make a duplicate of it. Continue working with the \n   duplicate.\n1. Work through the notebook as if you were a student, make adjustments as \n    you go. Iterate restarting the kernel, clearing the cell outputs, saving,\n    duplicating and working though until satisfied.\n1. Save the final version of the worksheet. Duplicate it.\n1. Open the duplicate worksheet. Make sure all the appropriate cell data is \n    cleared. Then select \"Disallow menu in Notebook\" item in the \"JPSL \n   Instructor Tools\" section of the Jupyter Lab command palette (figure 1). \n   This will deactivate the menu and block students from easily \n    reinstalling it. Save the notebook and distribute this copy to students.\n\u003c!--\n5. Use the menu to add to this initialization cell the command to get the \n   student names and timestamp the notebook. This will simultaneously \n   protect the cell.\n--\u003e\n## Requirements\n* JupyterLab \u003e= 4.0.0\n* notebook \u003e= 7.0.0\n* jupyter-datainputtable \u003e=0.8.0\n\n## Install\n\nInstallation using pip into a virtual environment is recommended. My \nfavorite way to manage virtual environments is using\n[pipenv](https://pipenv.pypa.io/en/latest/). You should also consider\n[venv](https://docs.python.org/3/library/venv.html) which is part of the \nstandard Python library and [hatch](https://hatch.pypa.io/latest/) for \ndevelopment.\n\n__Option 1__: Recommended, as this will install all of the Jupyter Physical \nScience Lab packages an Instructor might need. Use the\n[JPSLInstructor pseudo package](https://github.com/JupyterPhysSciLab/JPSLInstructor).\n\n```bash\npip install JPSLInstructor\n```\n\n__Option 2__: Install just this package and its minimal requirements. You \nmay want to do this if you are just making worksheets, do not need live \ndata acquisition or want to use a very specific set of packages.\n\n```bash\npip install jupyter_instructortools\n```\n\n## Contributing \n\n### Development install\nNote: You will need NodeJS to build the extension package.\n\nThe `jlpm` command is JupyterLab's pinned version of\n[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use\n`yarn` or `npm` in lieu of `jlpm` below.\n\n```bash\n# Clone the repo to your local environment\n# Change directory to the jupyter_datainputtable directory\n# Install package in development mode\npip install -e \".\"\n# Link your development version of the extension with JupyterLab\njupyter labextension develop . --overwrite\n# Rebuild extension Typescript source after making changes\njlpm build\n```\n\nYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.\n\n```bash\n# Watch the source directory in one terminal, automatically rebuilding when needed\njlpm watch\n# Run JupyterLab in another terminal\njupyter lab\n```\n\nWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).\n\nBy default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:\n\n```bash\njupyter lab build --minimize=False\n```\n\n### Development uninstall\n\n```bash\npip uninstall jupyter_instructortools\n```\n\nIn development mode, you will also need to remove the symlink created by `jupyter labextension develop`\ncommand. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`\nfolder is located. Then you can remove the symlink named \n`jupyter-instructortools` within that folder.\n\n### Testing the extension (currently incomplete)\n\n#### Frontend tests\n\nThis extension is using [Jest](https://jestjs.io/) for JavaScript code testing.\n\nTo execute them, execute:\n\n```sh\njlpm\njlpm test\n```\n\n#### Integration tests\n\nThis extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).\nMore precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.\n\nMore information are provided within the [ui-tests](./ui-tests/README.md) README.\n\n### Packaging the extension\n\nSee [RELEASE](RELEASE.md)\n## Issues or comments\n\nIssues or bugs should be reported via the project's [issues pages](https://github.com/JupyterPhysSciLab/jupyter-instructortools/issues).\n\nCopyright - Jonathan Gutow, 2020 - 2024.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupyterphysscilab%2Fjupyter-instructortools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjupyterphysscilab%2Fjupyter-instructortools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupyterphysscilab%2Fjupyter-instructortools/lists"}