scripts for my gemini capsule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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
from bsb import printbsb

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)
  printbsb([passages[0]], False, False)
  printoeb([passages[0]], False, False)
  printwebp([passages[0]], False, False)
  printwebp([passages[0]], False, False, printStrongs=True)




if __name__ == '__main__':
  qs = os.getenv("QUERY_STRING") or (sys.argv[1] if len(sys.argv) >= 2 else '')
  main(qs)