Skip to content
README.md 1.6 KiB
Newer Older
gabriele-h's avatar
gabriele-h committed
# Access Catalogue Data

For general information on what is covered in this project, please
visit <https://labs.onb.ac.at/en/dataset/catalogue/>. For now the
following things are covered:

* sru - Get catalogue data via SRU as etree-Elements
* marc\_tools - Extract specific information from the catalogue data

## Getting Started

The module itself does not have special requirements.

### Prerequisites

You should use a recent Python version, 3.6 and up. If you want to
make use of the included tests for the marc\_tools, you will need
to install the module `pytest`.

### Usage

If you want to access ÖNB catalogue data, you can use the following
import statement to get started:

`from catalogue import onbsru`

And then instantiate the OnbRecordRetriever class:

`myinstance = onbsru.OnbRecordRetriever()`

For now this will allow you to retrieve one specific record via one of
the following unique IDs:

* barcode - Barcode
* ac\_num - ID within the Austrian Library Network
* mms\_id - Ex Libris Alma's internal ID

For example:

`myinstance.by_ac_num("AC12345678")`

## Running the tests

Right now there is only one test file for the extraction of
MARC-categories. The tests are implemented using pytest.

### Testing the patterns for marc\_extractor

These tests will check if marc\_extractor.py is accepting the right
kinds of patterns and rejecting the wrong ones.

`pytest marc_tools/tests/test_marc_extractor.py`

# Built With

* Python3

# Authors

* **Stefan Karner** - Senior Developer
* **Gabriele Höfler** - Junior Developer

# License

This project is licensed under the MIT License - see the LICENSE file
for details.