Coder Social home page Coder Social logo

kirschbombe / feed_ursus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uclalibrary/feed_ursus

0.0 2.0 0.0 178 KB

Script to process CSVs into an Ursus-ready solr index.

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 0.41% Python 63.23% HTML 1.69% XSLT 34.66%

feed_ursus's Introduction

feed_ursus

Script to process CSVs into an Ursus-ready solr index.

Using feed_ursus.py

First, make sure you have Python 3 available and install pipenv. Then you can use pipenv to install the project's dependencies in a new virtual environment:

pipenv install

Then, to run commands inside the new virtual environment, you can either enter pipenv shell to enter the virtual environment, or you can prefix your commands with pipenv run.

You can then use the script to convert a csv into a json document that follows the data model of an Ursus solr index:

pipenv run feed_ursus.py [path/to/your.csv]

This repo includes a docker-compose.yml file that will run local instances of solr and ursus for use in testing this script. To use them (first install docker and docker compose):

docker-compose up --detach
docker-compose run web bundle exec rails db:setup

Give it a minute or so for solr to get up and running, then point feed_ursus.py directly at the new solr:

pipenv run ./feed_ursus.py [path/to/your.csv] --solr_url http://localhost:6983/solr/californica

When the command finishes running, you can see your new site at http://localhost:6003

Running the test suite

First, install the dev dependencies and enter the virtualenv:

pipenv install --dev
pipenv shell

Then you can simply run:

pytest

This will run:

Caveats

IIIF Manifests

When importing a work, the script will always assume that a IIIF manifest exists at https://iiif.library.ucla.edu/[ark]/manifest, where [ark] is the URL-encoded Archival Resource Key of the work. This link should work, as long as a manifest has been pushed to that location by importing the work into Fester or Californica. If you haven't done one of those, obviously, the link will fail and the image won't be visible, but metadata will import and be visible. A manifest can then be created and pushed to the expected location without re-running feed_ursus.py.

feed_ursus's People

Contributors

sourcefilter avatar pghorpade avatar kirschbombe avatar jendiamond avatar

Watchers

James Cloos 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.