Skip to content

a Python3 program that searches a single MARC record via a given id (controlfield 001) in a given (binary) MARC records file and writes it into a single (binary) MARC file

License

Notifications You must be signed in to change notification settings

slub/searchmarcrecord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

searchmarcrecord

searchmarcrecord is a Python3 program that searches a single MARC record via a given id (controlfield 001) in a given (binary) MARC records file and writes it into a single (binary) MARC file

Requirements

Run

  • clone this git repo or just download the searchmarcrecord.py file
  • run ./searchmarcrecord.py
  • for a hackish way to use searchmarcrecord system-wide, copy to /usr/local/bin

Install system-wide via pip

  • via pip:
    sudo -H pip3 install --upgrade [ABSOLUTE PATH TO YOUR LOCAL GIT REPOSITORY OF SEARCHMARCRECORD]
    
    (which provides you searchmarcrecord as a system-wide commandline command)

Usage

searchmarcrecord [-h] -id ID -input-file INPUT_FILE -output-file
                        OUTPUT_FILE

required arguments:

-id ID                              the record id (default: None)
-input-file INPUT_FILE              the input MARC file (with multiple records) (default: None)
-output-file OUTPUT_FILE            the output MARC file (with one found record) (default: None)

optional arguments:

-h, --help                          show this help message and exit
-continue-search-after-first-hit    continues search after first hit, i.e., also determines whether multiple records for the given id occur in the input MARC records file (default: False)

Usage example

searchmarcrecord -id [MARC record ID (IN CONTROL FIELD 001)] -input-file [INPUT BINARY MARC RECORDS FILE] -output-file [OUTPUT BINARY MARC RECORD FILE (CONTAINING THE FOUND MARC RECORD)]

About

a Python3 program that searches a single MARC record via a given id (controlfield 001) in a given (binary) MARC records file and writes it into a single (binary) MARC file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages