Get started with ‘The National Bibliography of Scotland’ with this Jupyter Notebook.


Whether or not you have experience programming or working with data, this Notebook will give you a starting point for analysing metadata in MARC format. Using Python and several of its libraries, including Pandas and ElementTree, the Notebook demonstrates how to:

– Load an XML file

– Extract information from bibliographic metadata in MARC XML format

– Create a table of select metadata fields and export it as a CSV file 

Questions this Notebook can help you begin investigating include:

– What years are books published in the National Bibliography of Scotland so far?

– What topics does the National Bibliography of Scotland cover so far?

– How many works are included in the National Bibliography of Scotland so far?

– In what languages are works written in the National Bibliography of Scotland so far? 

Example of publication included in National Bibliography of Scotland

If you have never used a Jupyter Notebook before, we recommend visiting Tim Sherratt’s introduction to Jupyter Notebooks.


A note on the data

The text used in Exploring The National Bibliography of Scotland comes from metadata in the National Bibliography of Scotland (NBS), which consists of select metadata records from National Library of Scotland’s catalogue. The acquisition of the works documented and the creation of the metadata used to describe them took place in a different historical context in which the prevailing values were not necessarily those held by the Library today; their inclusion is not an endorsement of the views expressed.


Access the Notebook

Explore The National Bibliography of Scotland (version 1) in one of three ways:

View in your browser

Open a static version of the Notebook in your browser.

Run an interactive version

Run an interactive version of the Notebook in Binder.

Please note that the interactive version may take several minutes to load.

Some code may not work fully when opened in Binder.

Download from GitHub

Download from GitHub to run locally on your machine with Jupyter Lab, Anaconda, or Miniconda.


Cite this Notebook

DOI: https://doi.org/10.34812/an7d-xk61

Dataset creator: National Library of Scotland

Dataset publisher: National Library of Scotland

Publication year: 2020

Suggested citation: National Library of Scotland. Exploring The National Bibliography of Scotland. National Library of Scotland, 2020. https://doi.org/10.34812/an7d-xk61


Which dataset did this project use?

This project used The National Bibliography of Scotland: The National Bibliography of Scotland on the Data Foundry website