From 5d004d82de91fac644cbe4bd596b0879f69d6fe5 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Mon, 11 Dec 2023 13:14:47 +0000 Subject: biblestudy.py: new script! --- biblestudy.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 biblestudy.py (limited to 'biblestudy.py') diff --git a/biblestudy.py b/biblestudy.py new file mode 100755 index 0000000..57356eb --- /dev/null +++ b/biblestudy.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# pip3 install bible-passage-reference-parser +from bible import parse_string +import os +import sys + +from lsv import printlsv +from oeb import printoeb +from webp import printwebp + +def main(qs): + if not qs: + print("10 Enter a scripture reference\r\n") + return + passages = parse_string(qs) + if type(passages[0]) == tuple: + print("51 " + str(passages[0][0]) + "'\r\n") + return + print("20 text/gemini\r\n") + print("# " + passages[0].format()) + # Attribution of minor citations for personal or non-commercial use can be provided as simply “LSV” or “Literal Standard Version.” Citations for commercial use, or distribution of the entire LSV Bible or entire book(s) of the LSV Bible, must be fully attributed and include both “Literal Standard Version (LSV)” and the name of our organization. + printlsv([passages[0]], False, passages[0].length() > 5) + printoeb([passages[0]], False, False) + printwebp([passages[0]], False, False) + + + +if __name__ == '__main__': + qs = os.getenv("QUERY_STRING") or (sys.argv[1] if len(sys.argv) >= 2 else '') + main(qs) -- cgit 1.4.1