Summary and Schedule

This lesson introduces Python fundamentals with examples from libraries, scholarly publishing and research data management: article processing charges from OpenAPC and publication metadata from the DataCite API. It does not cover other library data formats such as XML or MARC.

This lesson is an introduction to programming in Python for people working in libraries and research data management with little or no previous programming experience (see the Learner Profiles for examples of the kinds of people who might benefit from this lesson). It covers the basics of the Python language, the analysis of tabular data with the pandas library, and retrieving metadata from a web API. The lesson uses the JupyterLab computing environment and Python 3.

This edition is maintained by ZB MED – Information Centre for Life Sciences and is based on teaching material developed at ZB MED and on the Library Carpentry lesson Python Intro for Libraries.

Prerequisite

Prerequisites

  1. Learners need to understand what files and directories are and what a working directory is.

  2. Learners must install Python and JupyterLab before the workshop begins. Please see the setup instructions for details.

  3. Learners need an internet connection during the lesson, as the data is downloaded directly from the web.

Learning Objectives


After attending this training, participants will be able to:

  • Use core Python syntax, variables, data types, functions and methods in the JupyterLab interface.
  • Store data in lists and dictionaries, and control program execution with loops and conditional logic.
  • Load, inspect, filter and plot tabular data with the pandas library.
  • Retrieve publication metadata for DOIs from the DataCite API and work with JSON data.

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.

Installing Python Using Miniforge


Python is a popular language for scientific computing, and great for general-purpose programming as well. For this workshop we use Python version 3.10 or newer. Installing all of its scientific packages individually can be a bit difficult, so we use the Miniforge distribution of Python, which helps you take care of them all together.

Please refer to the Python section of the workshop website for installation instructions.

The lesson uses the following packages:

JupyterLab


We will teach Python using JupyterLab, a part of a family of Jupyter tools that includes Jupyter Notebook and JupyterLab, both of which provide interactive web environments where you can write and run Python code. If you followed the instructions linked above, JupyterLab is installed on your system. Alternatively, you can install JupyterLab on its own using conda, pip, or other popular package managers.

Create a folder for the workshop


Create a new folder on your Desktop called lc-python. We will save our notebooks and downloaded data in this folder.

Data


You do not need to download any data in advance. During the lesson we download:

Please make sure you have a working internet connection during the workshop.