Skip to content

alexandermendes/pybossa-z3950

Repository files navigation

pybossa-z3950

Build Status Coverage Status

A PyBossa plugin that uses Flask-Z3950 to provide Z39.50 integration.

Installation

# install dependencies
sudo apt-get install libxml2-dev libxslt-dev python-dev lib32z1-dev

# clone
git clone https://github.com/alexandermendes/pybossa-z3950 /home/pybossa/pybossa/plugins

# activate virtual env
source /home/pybossa/pybossa/env/bin/activate

# install plugin
cd /home/pybossa/pybossa/plugins/pybossa-z3950
python setup.py install
cd ..
cp -r pybossa-z3950/pybossa_z3950 pybossa_z3950

The plugin will be available after you next restart the server.

Configuration

You can provide Z39.50 database configuration details by adding the following variable to your main PyBossa configuration file:

Z3950_DATABASES = ["loc": {"db": "Voyager", "host": "z3950.loc.gov", "port": 7090}]

The example above is enough to allow you to search to the Library of Congress database. See the Flask-Z3950 documentation for more details.

HTTP API

The API provided by this plugin can be used to search databases via the Z39.50 protocol and retrieve results as JSON, HTML, MARCXML or raw string data.

By default, the API endpoints are located at:

GET /z3950/search/<db>/marcxml
GET /z3950/search/<db>/json
GET /z3950/search/<db>/html
GET /z3950/search/<db>/raw

See the Flask-Z3950 documentation for full details.

Testing

This plugin makes use of the PyBossa test suite while running tests. The Travis CI configuration file contains all of the required commands to set up a test environment and run the tests.

Contributing

See the CONTRIBUTING file for guidelines on how to suggest improvements, report bugs or submit pull requests.