Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added examples/__init__.py
Empty file.
60 changes: 60 additions & 0 deletions examples/print_verses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import argparse

import pythonbible as bible
from pythonbible.versions import DEFAULT_VERSION


def get_version(version: str) -> bible.Version:
if version in ["BSB", "BEREAN_STANDARD", "0"]:
return bible.Version.BEREAN_STANDARD
elif version in ["WEB", "WORLD_ENGLISH", "1"]:
return bible.Version.WORLD_ENGLISH
elif version in ["ASV", "AMERICAN_STANDARD", "2"]:
return bible.Version.AMERICAN_STANDARD
elif version in ["KJV", "KING_JAMES", "3"]:
return bible.Version.KING_JAMES
else:
raise NotImplementedError(f"Version {version} not implemented.")


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Print chosen verses from the Bible.")
parser.add_argument(
"-r",
"--references",
required=True,
type=str,
help="Specify the references of the verses to print.",
)

parser.add_argument(
"-v",
"--version",
type=str,
default=DEFAULT_VERSION,
help="Specify the version of the Bible to use.",
)
args = parser.parse_args()
if type(args.version) is not bible.Version:
VERSION = get_version(args.version)
else:
VERSION = args.version

print(f"Using version: {VERSION}\n")

references = args.references
norm_references = bible.get_references(references)

verse_ids_list = []
for ref in norm_references:
verse_ids_list.append(bible.convert_reference_to_verse_ids(ref))

for i, verse_ids in enumerate(verse_ids_list):
print(
f"\nPrinting from {norm_references[i].book} "
f"{norm_references[i].start_chapter}:{norm_references[i].start_verse} "
f"to {norm_references[i].end_chapter}:{norm_references[i].end_verse}\n"
)
for verse_id in verse_ids:
verse = bible.get_verse_text(verse_id, VERSION)
print(verse)
28 changes: 28 additions & 0 deletions pythonbible/bible/bibles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@
import pythonbible.bible.asv.plain_text as asv_plain_text
import pythonbible.bible.asv.plain_text_notes as asv_plain_text_notes
import pythonbible.bible.asv.plain_text_readers as asv_plain_text_readers
import pythonbible.bible.bsb.html as bsb_html
import pythonbible.bible.bsb.html_notes as bsb_html_notes
import pythonbible.bible.bsb.html_readers as bsb_html_readers
import pythonbible.bible.bsb.plain_text as bsb_plain_text
import pythonbible.bible.bsb.plain_text_notes as bsb_plain_text_notes
import pythonbible.bible.bsb.plain_text_readers as bsb_plain_text_readers
import pythonbible.bible.kjv.html as kjv_html
import pythonbible.bible.kjv.html_notes as kjv_html_notes
import pythonbible.bible.kjv.html_readers as kjv_html_readers
import pythonbible.bible.kjv.plain_text as kjv_plain_text
import pythonbible.bible.kjv.plain_text_notes as kjv_plain_text_notes
import pythonbible.bible.kjv.plain_text_readers as kjv_plain_text_readers
import pythonbible.bible.web.html as web_html
import pythonbible.bible.web.html_notes as web_html_notes
import pythonbible.bible.web.html_readers as web_html_readers
import pythonbible.bible.web.plain_text as web_plain_text
import pythonbible.bible.web.plain_text_notes as web_plain_text_notes
import pythonbible.bible.web.plain_text_readers as web_plain_text_readers
from pythonbible.errors import MissingVerseFileError
from pythonbible.versions import Version

Expand All @@ -29,6 +41,14 @@
"plain_text_notes": asv_plain_text_notes.bible,
"plain_text_readers": asv_plain_text_readers.bible,
},
Version.BEREAN_STANDARD: {
"html": bsb_html.bible,
"html_notes": bsb_html_notes.bible,
"html_readers": bsb_html_readers.bible,
"plain_text": bsb_plain_text.bible,
"plain_text_notes": bsb_plain_text_notes.bible,
"plain_text_readers": bsb_plain_text_readers.bible,
},
Version.KING_JAMES: {
"html": kjv_html.bible,
"html_notes": kjv_html_notes.bible,
Expand All @@ -37,6 +57,14 @@
"plain_text_notes": kjv_plain_text_notes.bible,
"plain_text_readers": kjv_plain_text_readers.bible,
},
Version.WORLD_ENGLISH: {
"html": web_html.bible,
"html_notes": web_html_notes.bible,
"html_readers": web_html_readers.bible,
"plain_text": web_plain_text.bible,
"plain_text_notes": web_plain_text_notes.bible,
"plain_text_readers": web_plain_text_readers.bible,
},
}


Expand Down
62,116 changes: 62,116 additions & 0 deletions pythonbible/bible/bsb/html.py

Large diffs are not rendered by default.

62,116 changes: 62,116 additions & 0 deletions pythonbible/bible/bsb/html_notes.py

Large diffs are not rendered by default.

62,116 changes: 62,116 additions & 0 deletions pythonbible/bible/bsb/html_readers.py

Large diffs are not rendered by default.

74,640 changes: 74,640 additions & 0 deletions pythonbible/bible/bsb/plain_text.py

Large diffs are not rendered by default.

74,640 changes: 74,640 additions & 0 deletions pythonbible/bible/bsb/plain_text_notes.py

Large diffs are not rendered by default.

74,640 changes: 74,640 additions & 0 deletions pythonbible/bible/bsb/plain_text_readers.py

Large diffs are not rendered by default.

143 changes: 143 additions & 0 deletions pythonbible/bible/bsb/titles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# This file was automatically generated by the pythonbible-parser package on 2024-09-04 23:38:51.599629+00:00.

from __future__ import annotations

from pythonbible.books import Book

short_titles = {
Book.GENESIS: "Genesis",
Book.EXODUS: "Exodus",
Book.LEVITICUS: "Leviticus",
Book.NUMBERS: "Numbers",
Book.DEUTERONOMY: "Deuteronomy",
Book.JOSHUA: "Joshua",
Book.JUDGES: "Judges",
Book.RUTH: "Ruth",
Book.SAMUEL_1: "1 Samuel",
Book.SAMUEL_2: "2 Samuel",
Book.KINGS_1: "1 Kings",
Book.KINGS_2: "2 Kings",
Book.CHRONICLES_1: "1 Chronicles",
Book.CHRONICLES_2: "2 Chronicles",
Book.EZRA: "Ezra",
Book.NEHEMIAH: "Nehemiah",
Book.ESTHER: "Esther",
Book.JOB: "Job",
Book.PSALMS: "Psalms",
Book.PROVERBS: "Proverbs",
Book.ECCLESIASTES: "Ecclesiastes",
Book.SONG_OF_SONGS: "Song of Solomon",
Book.ISAIAH: "Isaiah",
Book.JEREMIAH: "Jeremiah",
Book.LAMENTATIONS: "Lamentations",
Book.EZEKIEL: "Ezekiel",
Book.DANIEL: "Daniel",
Book.HOSEA: "Hosea",
Book.JOEL: "Joel",
Book.AMOS: "Amos",
Book.OBADIAH: "Obadiah",
Book.JONAH: "Jonah",
Book.MICAH: "Micah",
Book.NAHUM: "Nahum",
Book.HABAKKUK: "Habakkuk",
Book.ZEPHANIAH: "Zephaniah",
Book.HAGGAI: "Haggai",
Book.ZECHARIAH: "Zechariah",
Book.MALACHI: "Malachi",
Book.MATTHEW: "Matthew",
Book.MARK: "Mark",
Book.LUKE: "Luke",
Book.JOHN: "John",
Book.ACTS: "Acts",
Book.ROMANS: "Romans",
Book.CORINTHIANS_1: "1 Corinthians",
Book.CORINTHIANS_2: "2 Corinthians",
Book.GALATIANS: "Galatians",
Book.EPHESIANS: "Ephesians",
Book.PHILIPPIANS: "Philippians",
Book.COLOSSIANS: "Colossians",
Book.THESSALONIANS_1: "1 Thessalonians",
Book.THESSALONIANS_2: "2 Thessalonians",
Book.TIMOTHY_1: "1 Timothy",
Book.TIMOTHY_2: "2 Timothy",
Book.TITUS: "Titus",
Book.PHILEMON: "Philemon",
Book.HEBREWS: "Hebrews",
Book.JAMES: "James",
Book.PETER_1: "1 Peter",
Book.PETER_2: "2 Peter",
Book.JOHN_1: "1 John",
Book.JOHN_2: "2 John",
Book.JOHN_3: "3 John",
Book.JUDE: "Jude",
Book.REVELATION: "Revelation",
}

long_titles = {
Book.GENESIS: "Genesis",
Book.EXODUS: "Exodus",
Book.LEVITICUS: "Leviticus",
Book.NUMBERS: "Numbers",
Book.DEUTERONOMY: "Deuteronomy",
Book.JOSHUA: "Joshua",
Book.JUDGES: "Judges",
Book.RUTH: "Ruth",
Book.SAMUEL_1: "The First Book of Samuel",
Book.SAMUEL_2: "The Second Book of Samuel",
Book.KINGS_1: "The First Book of Kings",
Book.KINGS_2: "The Second Book of Kings",
Book.CHRONICLES_1: "The First Book of Chronicles",
Book.CHRONICLES_2: "The Second Book of Chronicles",
Book.EZRA: "Ezra",
Book.NEHEMIAH: "Nehemiah",
Book.ESTHER: "Esther",
Book.JOB: "Job",
Book.PSALMS: "The Psalms",
Book.PROVERBS: "The Proverbs",
Book.ECCLESIASTES: "Ecclesiastes or, The Preacher",
Book.SONG_OF_SONGS: "The Song of Solomon",
Book.ISAIAH: "Isaiah",
Book.JEREMIAH: "Jeremiah",
Book.LAMENTATIONS: "Lamentations of Jeremiah",
Book.EZEKIEL: "Ezekiel",
Book.DANIEL: "Daniel",
Book.HOSEA: "Hosea",
Book.JOEL: "Joel",
Book.AMOS: "Amos",
Book.OBADIAH: "Obadiah",
Book.JONAH: "Jonah",
Book.MICAH: "Micah",
Book.NAHUM: "Nahum",
Book.HABAKKUK: "Habakkuk",
Book.ZEPHANIAH: "Zephaniah",
Book.HAGGAI: "Haggai",
Book.ZECHARIAH: "Zechariah",
Book.MALACHI: "Malachi",
Book.MATTHEW: "Matthew",
Book.MARK: "Mark",
Book.LUKE: "Luke",
Book.JOHN: "John",
Book.ACTS: "The Acts of the Apostles",
Book.ROMANS: "Paul’s Letter to the Romans",
Book.CORINTHIANS_1: "Paul’s First Letter to the Corinthians",
Book.CORINTHIANS_2: "Paul’s Second Letter to the Corinthians",
Book.GALATIANS: "Paul’s Letter to the Galatians",
Book.EPHESIANS: "Paul’s Letter to the Ephesians",
Book.PHILIPPIANS: "Paul’s Letter to the Philippians",
Book.COLOSSIANS: "Paul’s Letter to the Colossians",
Book.THESSALONIANS_1: "Paul’s First Letter to the Thessalonians",
Book.THESSALONIANS_2: "Paul’s Second Letter to the Thessalonians",
Book.TIMOTHY_1: "Paul’s First Letter to Timothy",
Book.TIMOTHY_2: "Paul’s Second Letter to Timothy",
Book.TITUS: "Paul’s Letter to Titus",
Book.PHILEMON: "Paul’s Letter to Philemon",
Book.HEBREWS: "The Letter to the Hebrews",
Book.JAMES: "The Letter from James",
Book.PETER_1: "Peter’s First Letter",
Book.PETER_2: "Peter’s Second Letter",
Book.JOHN_1: "John’s First Letter",
Book.JOHN_2: "John’s Second Letter",
Book.JOHN_3: "John’s Third Letter",
Book.JUDE: "The Letter from Jude",
Book.REVELATION: "The Revelation to John",
}
Empty file.
62,220 changes: 62,220 additions & 0 deletions pythonbible/bible/web/html.py

Large diffs are not rendered by default.

Loading