Collection import script for BDRC's eReader
Import script for the BDRC embeded reader.
This script takes a TSV file (in the input/
folder), generated from a spreadsheet representing the collection, and outputs a .trig file (in the output/
folder), ready to be imported in BDRC's database to generate the iframe code.
Index
, site, github user, catalog
- khampagar.org, https://github.com/khampagar དཀར་ཆག
- vajravidya.org, https://github.com/thrangu དཀར་ཆག
- glorioussakya.org, https://github.com/Sakya-center དཀར་ཆག
- gadenjangtse.org, https://github.com/Garden-jangtse དཀར་ཆག
- loselingmonastery.net, https://github.com/Loseling དཀར་ཆག
- tibetanlibrary.org/bo/, https://github.com/Tibetan-library དཀར་ཆག
- theyungdrungbon.com, https://github.com/geleknyima, དཀར་ཆག
- cuts.ac.in, https://github.com/Cutac དཀར་ཆག
- shechen.org, https://github.com/shechenorg དཀར་ཆག
- namdroling.or, https://github.com/namdroling དཀར་ཆག
- dzongsarinstitute.org.in, https://github.com/dzongsarshedra, དཀར་ཆག
- gadenshartse.org, https://github.com/gadenshartse དཀར་ཆག
- palpung.org, https://github.com/palpung དཀར་ཆག
- gyudra.com, https://github.com/gyudra དཀར་ཆག
- sarah.instituteofbuddhistdialectics.org, https://github.com/sarahcollege དཀར་ཆག
- sakyacollege.org, https://github.com/sakyacollege དཀར་ཆག
- internationalbuddhistacademy.org, https://github.com/internationalbuddhistacademy དཀར་ཆག
- gomanglibrary.com, https://github.com/gomanglibrary དཀར་ཆག
- serajeyrigzodchenmo.org, https://github.com/serajeyrigzodchenmo དཀར་ཆག
- དཀར་ཆག
- tashilhunpo.org, https://github.com/tashilhunpo དཀར་ཆག
- kirti92.org, https://github.com/Kirtigonpa དཀར་ཆག
- དཀར་ཆག
- དཀར་ཆག
- songtsenlibrary.net, དཀར་ཆག
- དཀར་ཆག
- དཀར་ཆག
- དཀར་ཆག
- rigzod.org, དཀར་ཆག
- serameymonastery.org, དཀར་ཆག
- དཀར་ཆག
- tbrc.org, དཀར་ཆག
- lopenling.org, དཀར་ཆག
Dependency installation
$ pip3 install -r requirements.txt
It may also be necessary to:
pip3 install setuptools
before the requirements.txt.
Running the script
To convert all csv files into an RDF graph, run
$ python3 tsvtordf.py
and then execute the command given as output to upload the new data in the database.
Input file format
To create a tsv catalog, copy-paste the catalog from a spreadsheet in a copy of an existing tsv.
Each line of the spreadsheet should only contain one value. Section and subsections only need to contain the names, while works should contain a BDRC Work ID. Titles from BDRC will be displayed by default. You can replace them with a custom title by adding a space and the custom title after the Work ID.
[spreadsheet screenshot]
For texts running from a specific page to another page, add these four things to the tsv files (\<start volume> and \<end volume> are optional):
W123(120,347,3,5) title
W123(<start page>,<end page>,<start volume>,<end volume>) title
Setting up an embedded reader
Iframe code:
<iframe src="http://library.bdrc.io/scripts/embed-iframe.html?work=bdr:W1ERI#######&origin=website.com"></iframe>