Coder Social home page Coder Social logo

uchicago-library / extract_marc_from_vufind Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 113 KB

A project to solve the pesky problem of pulling MARC records from your Solr index

License: GNU Lesser General Public License v3.0

Python 100.00%
solr marc extraction python36 library vufind extract-marc

extract_marc_from_vufind's Introduction

marcExtraction

This is a Python library that allows a consumer to extract MARC records from

  1. a file exported to disk
  2. a VuFind API

Quick start

  1. git cone [email protected]:uchicago-library/extract_marc_from_vufind
  2. cd extract_marc_from_vufind
  3. python -m venv venv
  4. source venv/bin/activate
  5. pip install -r requirements.txt
  6. python setup.py develop

And you are ready to start hacking new functionality to the code base. Don't forget to follow good branching and open source citizen etiquette when you're doing it though!

How to Use the Library

If you are looking to find some particular subset of a bunch of MARC records that you have on-disk, you can do something like the following.

>>> from marcextraction.interfaces import OnDiskSearcher
>>> searcher = OnDiskSearcher(location='/path/to/a/bunch/of/marc/record/files')
>>> results = searcher.search('banana', '245', ['a'])

This example will do the following

  1. Instantiate an instance of OnDiskSearcher with a list of valid MARC records at /path/to/a/bunch/of/marc/record/files
  2. Perform a search on the MARC records for any record with banana in MARC field '245', subfield 'a'.

Still, you might be in an organization using OLE. In which case, you could do something like this.

>>> from marcextraction.interfaces import SolrIndexSearcher
>>> searcher = SolrIndexSearcher('http://your.domain/path/to/index', 'ole', 'ole')
>>> results = searcher.search('banana', '245', ['a'], rows=100)

This example does the same thing as the earlier example except this time it's searching a SOLR index.

If you want to extract a particular MARC record from OLE, do the following:

>>> from marcextraction.interfaces import OLERecordFinder
>>> getter = OLERecordFinder(100134, 'domain.of.ole.sru.app', 'http', '/path/to/app'
>>> getter.get_record()

Internal Project Management

Additional Links

Author

extract_marc_from_vufind's People

Contributors

verbalhanglider avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.