Summary and Setup

This workshop will focus on tools and concepts that are a step beyond an introductory python workshop. The learner will be assumed to have a basic understanding of the following python / programming concepts:

  • Basic python syntax
  • Writing Conditionals and “For” loops
  • Installing and running third party libaries
  • Basic Version control with git

We will cover the following topics in the course of this workshop:

  • Virtual Environments
  • Classes and Object Oriented Programming
  • Inheritance and Composition
  • Creating a Python Module
  • Static Code Analysis
  • Unit Testing
  • Publishing a python package

Prior to the workshop, please ensure that you have a working python installation (3.9 or higher) and the uv package manager installed. Setup instructions for both can be found below.

Prerequisite

This workshop content assumes that you have the following prerequisites:

  • A laptop or desktop computer running Windows, MacOS, or Linux
  • An installation of Python 3.9 or later
  • An installation of the UV package management tool
  • (Optional) A GitHub account
  • (Optional) A TestPyPi account
  • (Optional) Git Version Control, authenticated to your GitHub account

Software Setup - Python


This workshop relies on an installation of python on your device. You will need to have at least python version 3.9 or later for the project that we will create here.

If you do not already have python installed on the device you are bringing to the workshop, you can go to the python.org downloads page and download the most recent version.

Software Setup - UV


We will also be working with the UV package management tool. You can follow the install instructions found on the project website.

Software Setup - git and GitHub (Optional)


Callout

We will be demonstrating the use of GitHub during the workshop, however if you would prefer not to use the service it is not required to have an account in order to participate in the workshop.

We will be using git and GitHub to manage our code during the workshop. If you do not already have a GitHub account, you can create one for free at github.com.

Once you have an account, you will need to authorize git on your device to push code to your GitHub account. If you are familiar with SSH keys, you can use those. If not, you can use a personal access token (PAT).

Creating a Personal Access Token

Once you are logged into GitHub, click on your profile icon in the upper right corner of the screen, and select “Settings” from the dropdown menu. On the left side of the screen, select “Developer settings”, then “Personal access tokens”, and finally “Fine-grained tokens”.

Select “Generate new token”, then “Generate new token” again on the next screen. You will be prompted to give your token a name, description and expiration date. Under “Repository access”, select “All repositories”. Click the “Add Permissions” button and select “Contents” and “Commit Statuses”. Update the dropdown for each to “Read and write”. Finally, click the “Generate token” button at the bottom of the page.

Your token is only ever shown once, so be sure to either copy it to your clipboard or leave the window open while you complete the next step.

Authorizing git to use your Personal Access Token

On your device, open a command line / terminal window. You will need to configure git to use your PAT when pushing code to GitHub. You can do this by running the following commands:

BASH

git config --global credential.helper store

Then, run the following command, replacing your-username with your GitHub username:

BASH

git clone https://github.com/your-username/your-repo.git

You will be prompted for your GitHub username and password. For the password, paste in the PAT you created in the previous step. Your credentials will be stored on your device, and you should not have to enter them again.

Account Setup - TestPyPi (Optional)


We will be using TestPyPi to publish our package during the workshop. If you would like to follow along and publish your package to the test instance, you will need to create an account on TestPyPi if you do not already have one. You can do that at test.pypi.org.