scripts for my gemini capsule
Diffstat (limited to 'biblestudy.py')
-rwxr-xr-xbiblestudy.py30
1 files changed, 30 insertions, 0 deletions
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)