Universiteit Leiden

nl en


Studium Digitale: An Introduction to Object Oriented Programming and Library building in Python for Humanities Scholars

17 May 2019
Cleveringaplaats 1
2311 BD Leiden
Lipsius 126


Studium Digitale is a pilot for a workshop series that provides introductory or advanced knowledge on digital tools that benefit humanities Research. In the second installment of the workshop series we will introduce several advanced topics in Python programming that will help you create reusable programs for more efficient research: object orient programming and library creation.

At its core, programming allows us to leverage computers to increase our efficiency as researchers and open up new avenues for analysis. Yet many of the built-in objects and data types in Python are not sufficient for the types of analysis humanists do. Additionally, a common bottleneck in coding for humanities research is a tendency to reproduce the same code repeatedly. Sometimes we copy utility scripts into new project directories, other times we move functions directly from one script to another. This leads to needless duplication and increases the likelihood that we lose track of any incremental improvements. Object oriented programming, in which we create our own Python objects that can hold and analyze our data according to our own unique needs, provides a more sustainable approach that can bridge the first deficiency. Library creation deals with the second.

In this intermediate to advanced workshop you will learn how to create your own object structures (known as classes in Python) to both store and manipulate data. You will also learn how to structure your code project so it can be deployed as a library and used from anywhere on your computer, making it unnecessary to copy code into multiple directories and ensuring changes are universal. To facilitate this sustainable ethos, we will also cover the basics of using git for version control. At the end of the workshop, you will have a workflow for more efficient programming for your research projects. 

In this workshop you will learn about:

  • git basics (init, commit, branch, checkout, merge, push)
  • classes and inheritance
  • library structure

This workshop assumes you have a working knowledge of the Python programming language. You will also need Python 3 (preferably the Anaconda distribution) and git installed on your computer (the computers at in the workshop room have these installed already).

The workshop takes place in Lipsius/126 on May 17 and the program of the workshop is as follows (though the time for each section will be flexible depending on participant needs):

13:00-13:15:    Introduction 

13:15-14:00     Introduction to git 

14:00-15:00     Creating classes

                        (and understanding inheritance)

15:00-15:30     Coffee break 

15:30-16:00     Classes/Inheritance cont.

16:00-1700      Creating a library/module

Afterwards, we will have drinks at Pakhuis (Doelensteeg 8, 2311 VL Leiden)

The maximum number of participants is 20. If you are interested in participating, please sign up by sending an email to lucdh@hum.leidenuniv.nl.

This website uses cookies. More information