diff --git a/tools/genbooks.py b/tools/genbooks.py index 70bc53d..554ea67 100644 --- a/tools/genbooks.py +++ b/tools/genbooks.py @@ -6,38 +6,59 @@ import requests aliases = {'gn': 'gen', 'ex': 'exo', 'lv': 'lev', 'nm': 'num', 'numb': 'num', 'nmb': 'num', 'nmbs': 'num', 'dt': 'deu', 'deut': 'deu', 'deuter': 'deu', 'js': 'jos', 'josh': 'jos', 'jd': 'jdg', 'jdgs': 'jdg', 'rt': 'rut', '1s': '1sa', '1sam': '1sa', '1 s': '1sa', '1 sa': '1sa', '1 sam': '1sa', '2s': '2sa', '2sam': '2sa', '2 s': '2sa', '2 sa': '2sa', '2 sam': '2sa', '1k': '1ki', '1kgs': '1ki', '1king': '1ki', '1 k': '1ki', '1 ki': '1ki', '1 kgs': '1ki', '1 king': '1ki', '2k': '2ki', '2kgs': '2ki', '2king': '2ki', '2 k': '2ki', '2 ki': '2ki', '2 kgs': '2ki', '2 king': '2ki', '1c': '1ch', '1chr': '1ch', '1chron': '1ch', '1 c': '1ch', '1 ch': '1ch', '1 chr': '1ch', '1 chron': '1ch', '2c': '2ch', '2chr': '2ch', '2chron': '2ch', '2 c': '2ch', '2 ch': '2ch', '2 chr': '2ch', '2 chron': '2ch', 'ez': 'ezr', 'nh': 'neh', 'es': 'est', 'jo': 'jon', 'ps': 'psa', 'psalm': 'psa', 'pss': 'psa', 'pr': 'pro', 'prov': 'pro', 'ec': 'ecc', 'eccl': 'ecc', 'eccle': 'ecc', 'sn': 'sng', 'son': 'sng', 'song': 'sng', 'sol': 'sng', 'is': 'isa', 'isai': 'isa', 'jr': 'jer', 'jere': 'jer', 'jerem': 'jer', 'lm': 'lam', 'lamen': 'lam', 'eze': 'ezk', 'ezek': 'ezk', 'dn': 'dan', 'hs': 'hos', 'jl': 'jol', 'am': 'amo', 'ob': 'oba', 'obd': 'oba', 'obad': 'oba', 'mc': 'mic', 'na': 'nam', 'hb': 'hab', 'haba': 'hab', 'habak': 'hab', 'ze': 'zec', 'zf': 'zep', 'zef': 'zep', 'hg': 'hag', 'zech': 'zec', 'ml': 'mal', 'mala': 'mal', 'mt': 'mat', 'matt': 'mat', 'mk': 'mrk', 'lk': 'luk', 'jn': 'jhn', 'ac': 'act', 'rm': 'rom', 'rms': 'rom', '1cor': '1co', '1corin': '1co', '1 co': '1co', '1 cor': '1co', '1 corin': '1co', '2cor': '2co', '2corin': '2co', '2 co': '2co', '2 cor': '2co', '2 corin': '2co', 'gl': 'gal', 'ep': 'eph', 'ef': 'eph', 'ph': 'php', 'phil': 'php', 'cl': 'col', 'colo': 'col', '1thes': '1th', '1thess': '1th', '1 thes': '1th', '1 thess': '1th', '2thes': '2th', '2thess': '2th', '2 thes': '2th', '2 thess': '2th', '1tim': '1ti', '1 ti': '1ti', '1 tim': '1ti', '2tim': '2ti', '2 ti': '2ti', '2 tim': '2ti', 'ti': 'tit', 'pi': 'phm', 'philm': 'phm', 'philem': 'phm', 'he': 'heb', 'ja': 'jas', 'jam': 'jas', '1p': '1pe', '1pt': '1pe', '1pet': '1pe', '1 p': '1pe', '1 pe': '1pe', '1 pt': '1pe', '1 pet': '1pe', '2p': '2pe', '2pt': '2pe', '2pet': '2pe', '2 p': '2pe', '2 pe': '2pe', '2 pt': '2pe', '2 pet': '2pe', '1jon': '1jn', '1 jn': '1jn', '1 jon': '1jn', '2jon': '2jn', '2 jn': '2jn', '2 jon': '2jn', '3jon': '3jn', '3 jn': '3jn', '3 jon': '3jn', 'ju': 'jud', 'rv': 'rev', 'reve': 'rev'} use_translations = [ - "AAB", - "ASV", - "BBE", - "BSB", - "BST", - "GHT", - "KJAV", - "KJVA", - "LSV", - "LXXSA", - "MSB", - "NETB" - "NWB", - "PEV", - "RVA", - "T4T", - "TCENT", - "TNT", - "UBES", - "WEB" - "WEBC", - "WEBU", - "YLT", + "AAB", # Accessible Ancients Bible AAB + "BSB", # Berean Standard Bible BSB + "ENGWEBP", # World English Bible WEB + "GHT", # Garth's Hyper-literal Translation GHT + "eng_abt", # American Standard Version Byzantine Text ASVBT + "eng_asv", # American Standard Version (1901) ASV + #"eng_bbe", # Bible in Basic English BBE + "eng_boy", # Updated Brenton English Septuagint UBES + "eng_bre", # Brenton Septuagint Translation BST + "eng_emtv", # English Majority Text Version EMTV + #"eng_f35", # The New Testament with Commentary TNTC + "eng_fbv", # Free Bible Version FBV + "eng_glw", # God's Living Word GLW + #"eng_gnv", # Geneva Bible 1599 GNV + "eng_kja", # King James Version + Apocrypha KJVA + "eng_kjv", # King James (Authorized) Version KJAV + "eng_lsv", # Literal Standard Version LSV + "eng_lxx", # LXX2012: Septuagint in American English 2012 LXXSA + "eng_msb", # Majority Standard Bible MSB + "eng_net", # NET Bible NETB + "eng_pev", # Plain English Version PEV + "eng_rv5", # Revised Version with Apocrypha (1895) RVA + "eng_t4t", # Translation for Translators T4T + "eng_tce", # Text-Critical English New Testament TCENT + #"eng_tnt", # Tyndale New Testament TNT + "eng_ulb", # Unlocked Literal Bible ULB + "eng_w88", # Wycliffe Bible W88 + "eng_wbs", # Noah Webster Bible NWB + "eng_web", # World English Bible Classic WEBC + "eng_webu", # World English Bible Updated WEBU + "eng_wyc2017", # Wycliffe's Bible with Modern Spelling WBMS + "eng_wyc2018", # Wycliffe's Bible with Modern Spelling (Enhanced) WBMSE + "eng_ylt", # Young's Literal Translation YLT ] def get_translations(): req = requests.get("https://bible.helloao.org/api/available_translations.json") - translations = [t for t in - filter(lambda x: "language" in x and x["language"] == "eng", - req.json()[translations])] - return translations + t = req.json() + return [x for x in filter(lambda x: "language" in x and x["language"] == "eng", t["translations"])] -def filter_translations(): +def filter_translations(t=None): + tx = [] + if t is None: + t = get_translations() + for translation in t: + if "id" in translation and translation["id"] in use_translations: + tx.append(translation) + return tx + +def get_translation_meta(t): + req = requests.get(f"https://helloao.org${t["listOfBooksApiLink"]}") + t["books"] = req.json() if __name__ == "__main__": + pass +