In this repo you can find standard work of The Church of Jesus Christ of Latter-day Saints in machine-readable JSON format:
- Book of Mormon;
- Doctrine and Covenants;
- Pearl of Great Price.
Text was scraped from official church site.
Also in this repo you can find scripts to download texts again.
Installation:
- Clone repo
pipenv install
pipenv shell
- Run
python download.py ...
(see next section).
usage: download.py [-h] [-l [LANG [LANG ...]]]
[-s [SCRIPTURE [SCRIPTURE ...]]] [-o] [-t THREADS]
destination
Download standard works of the Church of Jesus Christ of Latter-day Saints in
machine-readable JSON format.
positional arguments:
destination path to save JSON files
optional arguments:
-h, --help show this help message and exit
-l [LANG [LANG ...]], --languages [LANG [LANG ...]]
list of languages to download; allowed values are
3-letters language key-codes: eng, spa, rus, fra...
-s [SCRIPTURE [SCRIPTURE ...]], --scriptures [SCRIPTURE [SCRIPTURE ...]]
list of scriptures to download; allowed values: bofm,
dc-testament, pgp
-o, --overwrite overwrite files if they exist
-t THREADS, --threads THREADS
number of threads to download in parallel
Download all scriptures in all available languages, then save it to output
folder:
python download.py output
Download all scriptures in Russian and Ukrainian languages:
python download.py output -l rus ukr
Download only Book of Mormon and D&C in Turkish language:
python download.py output -l tur -s bofm dc-testament
The same but overwrite existing file:
python download.py output -l tur -s bofm --overwrite
Optionally you can specify how many parallel threads will work (default: 30):
python download.py output -t 50
Root object of output JSON file has following keys:
title
- localized title of the book;uri
- unique identifier of the book;structure
- book structure tree, array of nestedStructureRecord
's (will be described later);contents
- mapping (unordered, may be in some random order) from content'suri
toContentRecord
(will be described later).
Each StructureRecord
is an object with following keys:
type
- may besection
orcontent
;title
- localized title of book, section or chapter;entries
- child objects, array ofStructureRecord
; may be only whentype
issection
;uri
- unique identifier of the content (thisuri
s are keys incontents
mapping).
Each ContentRecord
is an object with following keys:
uri
- unique identifier of content (the same as key);title
- localized title of section or chapter;data_type
- may bebook
,chapter
orfigure
;book_title
- localized title of book, usually appears in first chapter of any book;subtitle
- localized subtitle of book, usually appears in first chapter of some books; array of strings;book_intro
- book summary, usually appears in first chapter of any book; array of strings;chapter_name
- localized chapter name, i.e. "Chapter 1";chapter_summary
- localized summary of chapter; array of strings;text
- if content doesn't have verses, text will be placed here, each paragraph in separate string; array of strings;verses
- if content has verses, text will be placed here, each verse in separate object; array ofVerse
objects.
Each Verse
is an object with following keys:
number
- sequential number of verse in chapter, starting from 1;text
- text of the verse; string;
Example:
{
"title": "Test Book",
"uri": "/scriptures/test-book",
"structure": [
{
"type": "section",
"title": "The Book of Nephi",
"entries": [
{
"type": "content",
"title": "Chapter 1",
"uri": "/scriptures/test-book/ne/1"
},
{
"type": "content",
"title": "Chapter 2",
"uri": "/scriptures/test-book/ne/2"
},
],
},
{
"type": "content",
"title": "Official Declaration",
"uri": "/scriptures/test-book/od"
}
],
"contents": {
"/scriptures/test-book/ne/1": {
"uri": "/scriptures/test-book/ne/1",
"title": "Chapter 1",
"data_type": "chapter",
"book_title": "The Book of Nephi",
"subtitle": ["His Reign and Ministry"],
"chapter_name": "Chapter 1",
"chapter_summary": [
"summary",
"summary"
],
"verses": [
{
"number": 1,
"text": "Therefore...",
}
]
},
"/scriptures/test-book/ne/2": {
"uri": "/scriptures/test-book/ne/2",
"title": "Chapter 2",
"data_type": "chapter",
"chapter_name": "Chapter 2",
"chapter_summary": [
"summary",
"summary"
],
"verses": [
{
"number": 1,
"text": "Therefore...",
}
]
},
"/scriptures/test-book/od": {
"uri": "/scriptures/test-book/od",
"title": "Official Declaration",
"data_type": "chapter",
"chapter_name": "Chapter 2",
"text": [
"Official Declaration",
"of the First Presidency of the Church...",
"We declare to the world that..."
],
}
}
}