Package: getbible
getBible LibrarianThegetBibleLibrarian package is a Python library designed for efficiently retrieving the scripture reference across various translations.Installationpipinstallgetbiblesee package onpypiFeaturesGet ScriptureimportjsonfromgetbibleimportGetBible# Initialize the classgetbible=GetBible()# Get the scripture as JSONscripture_json=getbible.scripture("Genesis 1:1")print(scripture_json)# Outputs the JSON scripture as a string.# Get the scripture as dictionaryscripture_dict=getbible.select("Genesis 1:1")print(json.dumps(scripture_dict,indent=4))# Pretty-prints the dictionary.Using Translation AbbreviationsWhen utilizing theGetBibleclass to look up a reference, you can use the lowercase abbreviations of the target translation:importjsonfromgetbibleimportGetBible# Initialize the classgetbible=GetBible()scripture=getbible.select("Genesis 1:1-5",'aov')print(json.dumps(scripture,indent=4))# Pretty-prints the dictionary.In this code snippet,"aov"is used as the abbreviation for the Afrikaans Ou Vertaaling.Get ReferencefromgetbibleimportGetBibleReference# Initialize the classget=GetBibleReference()# Find well form referencereference=get.ref("Genesis 1:1-5")print(reference)# Outputs the dataclass [BookReference] { book: int, chapter: int, verses: list }Using Translation AbbreviationsWhen utilizing theGetBibleReferenceclass to look up a reference, you can use the lowercase abbreviations of the target translation:fromgetbibleimportGetBibleReference# Initialize the classget=GetBibleReference()reference=get.ref("Genesis 1:1-5",'kjv')In this code snippet,"kjv"is used as the abbreviation for the King James Version to speedup the search.Get Book NumberfromgetbibleimportGetBibleBookNumber# Initialize the classget_book=GetBibleBookNumber()# Find a book numberbook_number=get_book.number("Genesis")print(book_number)# Outputs the book number of "Genesis" = 1Available Translations and AbbreviationsTheGetBibleBookNumberpackage supports a range of Bible translations, each identified by a lowercase abbreviation. These abbreviations and the corresponding translation data are stored in thedatafolder.Finding Translation AbbreviationsTo find the available translation abbreviations:Go to thedatadirectory in the package.Each JSON file in this directory corresponds to a different translation.The file name (without the.jsonextension) represents the abbreviation for that translation.For instance, if you find a file namedkjv.json, thenkjvis the abbreviation for the King James Version translation.Using Translation AbbreviationsWhen utilizing theGetBibleBookNumberclass to look up a book number, you should use these lowercase abbreviations:book_number=get_book.number("Gen","kjv",["aov","swahili"])In this code snippet,"kjv"is used as the abbreviation for the King James Version,"aov"for the Afrikaans Ou Vertaaling, and"swahili"for the Swahili Version.Source Installation (git)To installgetBibleLibrarian, you need to clone the repository and install the package manually. Ensure you have Python 3.7 or higher installed.gitclonehttps://git.vdm.dev/getBible/librarian.gitcdlibrarian
pipinstall.Development and TestingTo contribute or run tests, clone the repository and set up a virtual environment:gitclonehttps://git.vdm.dev/getBible/librarian.gitcdlibrarian
python-mvenvvenvsourcevenv/bin/activate# On Windows use `venv\Scripts\activate`pipinstall-e.Run tests using the standard unittest framework:python-munittestContributingContributions to thegetbibleLibrarian package are welcome. Please ensure to follow the coding standards and write tests for new features.LicenseThis project is licensed under the GNU GPL v2.0. See the LICENSE file for more details.