This module is used to parse MARC XML and OAI documents. Module provides API to query such records and also to create records from scratch.

Module also contains getters which allows highlevel queries over documents, such as get_name() and get_authors(), which returns informations scattered over multiple subfields.

Package is developed and maintained by E-deposit team.

Package structure

Parser is split into multiple classes, which each have own responsibility. Most important is class MARCXMLRecord, which contains MARCXMLParser, MARCXMLSerializer and MARCXMLQuery.

File relations

Import relations of files in project:


Class relations

Relations of the classes in project:



Module is hosted at PYPI, and can be easily installed using PIP:

sudo pip install marcxml_parser

Source code

Project is released as opensource (MIT) and source code can be found at GitHub:


Almost every feature of the project is tested by unittests. You can run those tests using provided script, which can be found in the root of the project.


This script expects that pytest is installed. In case you don’t have it yet, it can be easily installed using following command:

pip install --user pytest

or for all users:

sudo pip install pytest


$ ./
============================= test session starts ==============================
platform linux2 -- Python 2.7.6 -- py-1.4.26 -- pytest-2.6.4
collected 66 items

tests/ ..
tests/ ............
tests/ ...............................
tests/ .
tests/ .......
tests/structures/ .
tests/structures/ .
tests/structures/ .
tests/structures/ .
tests/structures/ .
tests/tools/ ........

========================== 66 passed in 1.14 seconds ===========================

Indices and tables