Coding For Librarians 2018

On Friday the 12th October, we held our second coding for librarians workshop in the DLR Lexicon. As with our last workshop, the day acted as a general introduction to computer programming and was facilitated by Joseph Greene, systems librarian at University College Dublin.

After the introductions and an ice breaker, the first half of the workshop focused on the basic concepts of coding such as the difference between closed and open source, what multitier architecture is, as well as practical uses in libraries for coding such as for creating MARC records for each post in a WordPress blog.

Following this, we were introduced to some basic coding in the form of an Excel Visual Basic for Applications (VBA) exercise, in which we got to create a new function in Microsoft Excel. It was a fairly simple function that would offer a discounted price of 10% if a customer was purchasing ten or more items but through creating this function the attendees were introduced to concepts that carried through and were relevant to the latter half of the workshop. The particular syntax (the grammar/language/structure in computer language) that was used was very important. That a computer program inputs, stores, or manipulates data, usually with some output. In the case of the Excel function created, our data was the two columns, with the price and quantity, and the output was the price, possibly with a discount. In order to get the function to do this, we broke the task down into tiny parts and inputted it into the VBA.

Using Rep.lit the attendees were then able to move on to learning the basics of Python. Being taught the core elements:

  • Variables – a storage location for an element of data with a name and a value
  • Arrays – a variable that contains lists of elements or variables
  • For loops – a basic structure that loops through a list and performs actions on each element in the list
  • If statements – a basic structure that allows to decision to be made and actions performed, usually based on comparison
  • Functions – block of code that follow a discreet set of instructions

And then how to combine these elements into a fully functioning program. The code attendees spent the evening writing was to have the program look at a list of call numbers and identify which numbers represented geography.

During the evening the importance of leaving comments in your code quickly became important, as it saves you having to read through the whole code to figure out what something does and why you put it there.

Another useful tip learned was how code is written in blocks, you do not have to write all the instructions in one place and can break it up into discrete functions. This means you only have to write one function once and can then reuse it throughout your program.

These exercises wonderfully demonstrated the practical uses of coding for librarians as well as helped equip the attendees with the confidence and knowledge to work with technical services. All of the CDG committee members in attendance thoroughly enjoyed the event and feedback for this event was excellent. We would like to thank everybody who attended and of course to Joseph for facilitating this event.

Post by Robert Alfis, Research Librarian at Dublin Business School


Author: laicdg

Career Development Group of the Library Association of Ireland.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s