MonashDataFluency / python-workshop-base

The master template repository for Monash Data Fluency Python workshop modules
https://MonashDataFluency.github.io/python-workshop-base/
Other
22 stars 21 forks source link
data-carpentry jupyter-notebooks python software-carpentry training training-materials workshop-materials

Python workshops base

This is a base repository for Data Fluency Python Workshop modules.

To add or modify content, edit the notebooks in workshops/docs/modules/notebooks.

Quick start

# Install pipenv to ~/.local/bin/pipenv
pip install --user pipenv

git clone https://github.com/MonashDataFluency/python-workshop-base.git
cd python-workshop-base

# Install dependencies
pipenv install

# Enter the virtual environment
pipenv shell
jupyter notebook
# Edit the notebooks in workshops/docs/modules/notebooks
# Ctrl-C in terminal to stop Jupyter when you are done
./build.sh

# To view the generated site
cd workshops
open http://127.0.0.1:8000 && mkdocs serve

If everything looks fine, commit your changes (ideally to a branch), git push and send a Pull Request.

To deploy the public docs, see here.


Setup

Install Pipenv (eg pip install pipenv).

Run:

pipenv install

You can enter the virtualenv with pipenv shell, or run single commands in the enviroment of the virtualenv with pipenv run.

Modifying and building

Workshop modules can be found in workshops/docs/modules/notebooks.

To edit and update a module:

Then run:

# Export the notebooks, build the docs
pipenv run ./build.sh

This script runs jupyter nbconvert to generate Markdown from the notebooks, then runs mkdocs build to generate the static HTML.

New modules should be listed in workshops/mkdocs.yml, workshops/docs/index.md and possibly workshops/docs/fullday.md and/or workshops/docs/halfday.md if they form part of the full or half day workshops.

Jupyter notebook conventions

The intention of developing the workshop materials directly from Jupyter notebooks is to:

  1. Ensure code examples run correctly, catch errors early.
  2. Make each module a self-contained unit, including pulling in dependencies.
  3. Enable generation of student and instructor notes from a single source.

Here are some conventions to follow to achieve this:

Viewing the generated site

You can view the site locally via:

pipenv shell
cd workshops
mkdocs serve

# or, run
# pipenv run bash -c "cd workshops; mkdocs serve"

Go to http://127.0.0.1:8000

Deploying the static site to Github Pages

To update the site at https://MonashDataFluency.github.io/python-workshop-base/, run:

pipenv run ./deploy.sh

License

This workshop material is made available under a Creative Commons Attribution license (CC-BY 4.0)

Parts of this content have been adapted from the Data Carpentry "Python for ecologists" workshop material, used under a CC-BY 4.0 license.

Code is made available under the MIT License.

See LICENCE.md for the full text.