Skip to main content

A package to read Marc data obtained from Aleph, the catalogue of the library of the University of Basel

Project description



Python library to read Marc obtained from Aleph, the catalogue of the library of the University of Basel.

This library supports Marc21, MARCXML, and AlephX.


The docstrings can be displayed with pydoc (from the project root): pydoc alephmarcreader.abstractalephmarcreader.AbstractAlephMarcReader . For the inner classes such as Person, run pydoc alephmarcreader.abstractalephmarcreader.AbstractAlephMarcReader.Person.


alephmarcreader.abstractalephmarcreader.AbstractAlephMarcReader provides methods to access Marc data. It is an abstract class that has two abstract methods __get_field and __get_subfield_text that have to be implemented in the subclass for the file format at hand.

Unit Tests

From the project root, run python -m unittest alephmarcreader.tests.test_[Marc[21|XML]|X]Reader.


  • pymarc: install with pip
  • lxml: install with pip

The library works both with python2 and python3.


Install the package with pip install alephmarcreader.

Example usage:

# import
from alephmarcreader import AlephMarcXMLReader

# Read data from local file
marc = AlephMarcXMLReader('example_file.xml')

# get some fields
author = marc.get_author()[0]
recipient = marc.get_recipient()[0]
date = marc.get_date()[0]

# print it

For an exhaustive list of the API, use pydoc, as described above.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alephmarcreader-1.1.0.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

alephmarcreader-1.1.0-py3-none-any.whl (21.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page