1 of 29

ETL with Python for Esploro Migration�

CASEY KOONS

SCHOLARLY COMMUNICATIONS LIBRARIAN

SUNY COLLEGE OF ENVIRONMENTAL SCIENCE AND FORESTRY

2 of 29

Who am I

  • Scholarly Communications Librarian
  • In snowy Syracuse New York
  • One of Four Librarians + Four Staff
  • Serving 1594 FTE Students
  • Migrated, implemented and administer Experts @ ESF, our instance of Esploro

3 of 29

Many Hats

  • Experts at ESF | Esploro
  • Credited Courses Information Literacy Instructor
  • Reference Librarian
  • Web Developer

4 of 29

Who am I to tell you about Python?

  • Neurodivergent
  • Life-Long Script-Kiddie

5 of 29

6 of 29

Project Based Learning�is a fine way to learn.

7 of 29

What is this presentation about?

Python scripts I used to address issues with data migration into Esploro.

Walking through files and directories

Parsing and editing xml files

Transforming data (dates, names)

Parsing and editing csv files

8 of 29

A review of Lists and Loops

9 of 29

Two Stories

The Bepress Digital Commons to Esploro Migration

Esploro Bulk Upload CSV file construction

10 of 29

Different workflow

T

E

L

11 of 29

Esploro Migration

12 of 29

Digital Commons metadata challenge

13 of 29

Issues with Digital Commons Metadata

Information was missing

The metadata did not fit the Migration Form

14 of 29

15 of 29

16 of 29

Need to make�bulk changes�to many xml files.

17 of 29

OS Walk – Spooky Stuff

18 of 29

XML ElementTree

19 of 29

Combine the os.walk and etree to bulk edit!

20 of 29

  • Align with Esploro Migration Form
  • Add Missing Data

21 of 29

Esploro Bulk CVS Upload

22 of 29

Lost ETDs

Source Data

Upload Format

23 of 29

Problems with Data

Professors' names entered in a single field – need first, last, etc.

Upload csv wants two different date types

24 of 29

NameParser

pip install nameparser

25 of 29

Python datetime

26 of 29

Better date math with dateutil

pip install python-dateutil

27 of 29

Constructing a CSV file with Python

28 of 29

Review of what Python can do:

WALK THROUGH FILE STRUCTURES WITH OS.WALK

READ AND WRITE TO XML FILES WITH XML.ETREE.ELEMENTTREE

PARSE NAME STRINGS TO FIRST, LAST, ETC, WITH NAMEPARSER.HUMANNAME

PARSE, FORMAT AND CALCULATE DELTAS IN DATES WITH DATETIME & DATEUTIL

READ, APPEND AND CONSTRUCT CSV FILES WITH CSV

29 of 29