Git Product home page Git Product logo

cudl-data-processing-xslt's Introduction

XSLT for item TEI -> JSON processing

This is used for processing TEI item data into JSON format for the cudl-viewer. It is used in the cudl data processing workflow, as a layer on the lambda function that converts item data.

IT IS IMPORTANT THAT THE DIRECTORY STRUCTURE IS PRESERVED as this is referenced in the lambda code.

Publishing the new XSLT

First ensure that you have committed and pushed any changed to git.

Then install the required modules:

pip install -r requirements.txt

To publish the version to s3 run the following script

Required: Python3.8, AWS credentials configured for use.

python3 publish_xslt_to_s3.py

This script will zip up the xslt and uploads to s3.

Once done remember the commit the new version with

git add VERSION
git commit -m "Releasing new version"
git push

Once complete you can deploy the new version by editing the configuration in https://github.com/cambridge-collection/cudl-terraform

Building locally using Apache ant:

Prerequisites

Download and install

Link the data

Link a local checkout of the TEI data into the 'data' folder under the root level, e.g.

ln -s ~/projects/cudl-data-source/data/items data

Building page extracts in dist

Page transcripts and json can be built locally using:

ant -buildfile ./bin/build.xml

To only build transcripts use:

ant -buildfile ./bin/build.xml "transcripts"

To only build json use:

ant -buildfile ./bin/build.xml "json"

Tests

The test suite checks that:

  • each JSON file is syntactically valid
  • links to transcripts within the JSON resolve to an existing html file
  • each html file is pointed to by links within the JSON

Run the tests locally using:

ant -buildfile bin/test.xml

This command initiates a full build of the transcripts and json before running the tests. If you have already built the transcripts and json and wish only to run the tests, use:

ant -buildfile bin/build.xml "tests-only"

The results of the test are written to ./test.log

cudl-data-processing-xslt's People

Contributors

jlf44 avatar mjhawkins avatar shenuka-jayasinghe 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.