From b89730b479db401af40da09a49000142e1205339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriele=20H=C3=B6fler?= Date: Thu, 21 Nov 2019 12:00:35 +0100 Subject: [PATCH] Move info to subpackage READMEs --- README.md | 31 ++++++++++++++++--------------- sru/README.md | 30 +++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index faceefe..80510a6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ following things are covered: ## Getting Started -The module itself does not have special requirements. +The module does not require third party or local imports. ### Prerequisites @@ -19,25 +19,26 @@ to install the module `pytest`. ### Usage -If you want to access ÖNB catalogue data, you can use the following -import statement to get started: +#### sru -`from catalogue import onbsru` +Retrieve bibliographic records from Alma via SRU for any query or +by the following unique IDs: -And then instantiate the OnbRecordRetriever class: +* barcode - Barcode +* by\_marc\_009 - other system number, e. g. AC-number (OBV-specific UID) +* mms\_id - Ex Libris Alma's internal ID -`myinstance = onbsru.OnbRecordRetriever()` +There is a separate README for the [subpackage sru](sru/README.md) available. -For now this will allow you to retrieve one specific record via one of -the following unique IDs: +#### marc\_tools -* barcode - Barcode -* ac\_num - ID within the Austrian Library Network -* mms\_id - Ex Libris Alma's internal ID +Extract bibliographic data from MARC-XML. -For example: +There is a separate README for the [subpackage marc\_tools](marc_tools/README.md) +available. -`myinstance.by_ac_num("AC12345678")` +For an example of how *marc\_tools/marc\_extractor* can be used, +have a look at the Jupyter Notebook in [extract-bibliographic](../extract-bibliographic). ## Running the tests @@ -57,8 +58,8 @@ kinds of patterns and rejecting the wrong ones. # Authors -* **Gabriele Höfler** -* **Stefan Karner** +* Gabriele Höfler +* Stefan Karner # License diff --git a/sru/README.md b/sru/README.md index e9c223e..21a8ac1 100644 --- a/sru/README.md +++ b/sru/README.md @@ -10,7 +10,7 @@ When querying for multiple records, keep in mind that Ex Libris limits the retrieval of records to 10k. To use this module you will need to know at least the following -information: +information (there is a submodule with the necessary info for ONB): * The subdomain of the Alma installation * The institution code of the institution you want to query * Which format you want returned @@ -20,17 +20,32 @@ See also [Ex Libris' documentation on SRU](https://developers.exlibrisgroup.com/ ## Usage -From almasru instantiate RecordRetriever with the necessary information: +For general Alma-queries from *almasru* instantiate RecordRetriever +with the necessary information: ``` -onbalma = almasru.RecordRetriever('obv-at-oenb', '43ACC_ONB', 'marcxml') +from catalogue.sru import almasru +nzalma = almasru.RecordRetriever('obv-at-oenb', '43ACC_NETWORK', 'marcxml') ``` -If you want to query the Austrian National Library's catalogue, take a look at onbsru. +If you want to query the Austrian National Library's catalogue, +you can also use *onbsru*: -You can either query by unique ID (usually AC-number, MMS-ID or Barcode) or get multiple -records at once. If you query by unique ID and more than one record is returned, +``` +from catalogue.sru import onbsru +onbalma = onbsru.OnbRecordRetriever() +``` + +You can either query by unique ID or by a more general query. +If you query by unique ID and more than one record is returned, you will get a Not Unique-Exception. +There are the following unique IDs implemented as methods +of the *RecordRetriever()*: +* barcode - Barcode of a specific item +* by\_marc\_009 - other system number of a bibliographic record, + e. g. AC-number (UID used in the Austrian Library Network) +* mms\_id - Ex Libris Alma's internal ID of a bibliographic record + ### By Unique ID There are shorthands for AC-number, MMS-ID or Barcode: @@ -49,7 +64,8 @@ onbalma.get_unique('alma.local_control_field_009=AC13425588') For documentation on what can be queried here, look at the out of the box [search indexes](https://knowledge.exlibrisgroup.com/Alma/Product_Documentation/010Alma_Online_Help_(English)/040Resource_Management/040Metadata_Management/180Search_Indexes/050MARC_21_Search_Indexes) of Alma and at the [explain operation](https://obv-at-oenb.alma.exlibrisgroup.com/view/sru/43ACC_ONB?version=1.2&operation=explain) of SRU. ``` -onbalma.get_multiple('alma.date_of_publication=1848 and alma.country_of_publication=XA-AAAT') +query = "alma.date_of_publication=1848 and alma.country_of_publication=XA-AAAT" +onbalma.get_multiple(query) ``` # Author -- GitLab