Giter VIP home page Giter VIP logo

abnormal-hieratic-indexer's Introduction

Abnormal Hieratic Indexer

Script that indexes annotations in the Abnormal Hieratic Global Portal. This script is specifically tailored towards the annotations created for the AHGP.

Annotations in the AHGP are stored in a Simple Annotation Server, but for search we use Elasticsearch.

Installation

This script was developed with Python 3.6+. It may run on other versions, but this is not tested.

The indexer depends on requests and beautifulsoup4, both of which may be installed with pip or pip3 (depending on your system). On some Linux distributions they may instead be available as packages for your package manager.

pip install requests beautifulsoup4

Usage

Currently all information needed to run is defined within the script. This includes the endpoint of the ElasticSearch server and the base URL of the SimpleAnnotationServer endpoint. If you need to adjust these settings, modify the script.

To enable periodic indexing, you can set up a cronjob or Systemd timer.

cronjob

This is an example cronjob that uses the Red Hat software collection for Python 3.6 and saves standard out and standard error streams to files. (Note that cronjobs need to escape the % in file names, whereas in shell scripts the extra backslashes do not work.)

33 8,12,16,20 * * * scl enable rh-python36 'python /home/beheer/index_annotations.py' > "/var/log/anno-index/indexing_$(date '+\%Y\%m\%d\%H\%M').log" 2> "/var/log/anno-index/error_$(date '+\%Y\%m\%d\%H\%M').log"

Author and license

Abnormal Hieratic Indexer has been created by Ben Companjen at the Centre for Digital Scholarship.

© 2019 Leiden University Libraries

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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.