Skip to main content

A set of tools for converting between OSIS abbreviations and localized biblical book names

Project description

OSIS Book Tools

This packages contains tools for converting between OSIS abbreviations (both IDs and paratext abbreviations) for books in the canonical Old and New Testaments and localized book names.

The core of this is a sqlite database which does all the mappings, and ensures basic data integrity. Data is currently loaded once during module init. After that, all operations are in-memory.

This abbreviations were compiled from https://wiki.crosswire.org/OSIS_Book_Abbreviations (fetched 2019-03-25).

Usage Examples

Reference a book via enumeration value

OSISBook.Gen    # Genesis
OSISBook._1Sam  # 1 Samuel (note the leading underscore to make the identifier valid)

Construct a book from a paratext value

OSISBook.from_paratext("GEN")

Get the paratext abbreviation for a book

OSISBook.Gen.paratext_abbreviation

Get the localized name of a book

This function expects the shortest possible ISO 639 code available for the language. English is guaranteed to be available, so use this as a fallback.

OSISBook.Gen.localized_name("en")

Get the localized chapter descriptor for a book

This function returns the chapter descriptor, which may be slightly different from the name. Use this when constructing a reference string. For example, you write Psalm 23, not Psalms 23. This is the difference between localized_name and chapter_descriptor.

Like localized_name, this function expects the shortest possible ISO 639 code available for the language. English is guaranteed to be available, so use this as a fallback. If a localized name exists, a chapter descriptor must also exist.

OSISBook.Gen.chapter_descriptor("en")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osis_book_tools-1.0.1.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

osis_book_tools-1.0.1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page