1 of 9

Tools & Practices Workshop

A Python “WebQuest”

Exercise to Build a Usable Python Project

2 of 9

Expectations

This will take more than one day.

Many of these tools have a significant learning curve. You can’t learn everything in one day about Git, Python packaging, or Sphinx.�

However just a few baby steps with these tools can take you far in a short time!

3 of 9

Motivation - Code Usability

  • Can you leverage Python packages by other developers?
  • Can other developers use your code?
  • Can you incorporate your own code into future projects?
  • Does your code function as expected?
  • Is your code readable and modifiable?
  • Is your code installable?
  • How is your code documented?

4 of 9

Essentials for Making Code Usable

  • Packaging
  • Automated Tests
  • Installing Tools
  • Coding Standards & Code Checkers
    • Helps code readability and modifiability!
  • Documentation
  • Logging

5 of 9

Python Packaging

  • Use of 3rd Party Code
    • Install by declaring dependencies using setuptools
  • Enabling Others to Use Your Code
    • Standard setuptools package structure
    • Docs
    • Publish on PyPI
  • Data Files
    • Config files, etc.

6 of 9

Some of the Tools

  • venv (or virtualenv)
  • pip
  • Git and GitHub
  • cookiecutter
  • PyPI, the Python Package Index
  • py.test
  • Sphinx

7 of 9

Tutorial Structure: Web Quest

  • “Web Quest” format Wikipedia article
  • Students given an inquiry-based activity
    • Research and complete task(s) using online web resources
    • Collaborate with peers; ask questions when stuck
  • This Approach is Experimental
    • Your help is needed to determine whether it’s an effective approach

8 of 9

Process

  • Printed Checklist of Tasks
    • Checklist and hints available here:
    • https://github.com/sheilatron/shiny_code_quest
    • Mark off progress, keep visible to teachers
  • Sprint on the Tasks
    • Each student performs tasks on laptop
    • Raise hands for help
    • Teachers available, students can help each other
    • Try to focus; turn off distractions (email, alerts, etc)

9 of 9

There Will Be A Test

(if you want one!)

Post Your Code & Docs

Students Can Review Each Other’s Work

Email URI to sheila@allendev.com