A package to read Marc data obtained from Aleph, the catalogue of the library of the University of Basel
Project description
alephmarcreader
General
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.
Documentation
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.
Design
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.
Dependencies
pymarc: install with piplxml: install with pip
The library works both with python2 and python3.
Usage
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
print(author.name)
print(recipient.name)
print(date)
For an exhaustive list of the API, use pydoc, as described above.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alephmarcreader-1.1.0.tar.gz.
File metadata
- Download URL: alephmarcreader-1.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72153831daea05511f087a4e4d4042b7d3595d83ae29763980a6a24719f98885
|
|
| MD5 |
c9fafc6cb28b5dd1c45029b1c38d0cd4
|
|
| BLAKE2b-256 |
b38e55403f45a3da54b6ccfab74181593af7ef0a87162a720eaf1cddc2db1520
|
File details
Details for the file alephmarcreader-1.1.0-py3-none-any.whl.
File metadata
- Download URL: alephmarcreader-1.1.0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adcf90ca3d5dcd848b49dbeaf438a03326fa603ff1e9a2b1da882379dffe3ff2
|
|
| MD5 |
2da0d7fa1b2fd2cea0dc0b8a672ba939
|
|
| BLAKE2b-256 |
177465302a211465782a1667607d1fdc205073239a10d09c1ef15c6071927c2a
|