Skip to main content

This module implements classes that I have developed to parse and output Bible references.

Project description

bible_reference

Parse, sort and pretty-print Bible references.

This module implements classes that I have developed to parse and output Bible references. With some 3,000 years of literary history, that’s not as simple a task as one might think, especially when dealing with several languages. Rudimentary datafiles for English are supplied, but the most detailed representation is for my native German.

If you have any questions or suggestions, contact me at Diedrich Vorberg ‹diedrich@tux4web.de›!

Some introduction

infofile.py

Information is stored in a special CSV-like textfile format documented in the infofile.py.

bible_reference.py

bible_reference.Canon

A canon is the representation of an order of Biblical Books loaded from a .canon (info-) file.

There is an internal (default) naming-scheme for Biblical books that consists of mostly tow-letter English abbreviations. That’s hardcoded in the info-files, not so much in the Python code. The order of the books in the .canon file will be the sort order of the books. These internal names are refered to throughout the code as a book’s intid.

bible_reference.BiblicalBook

Implement comparison (that is: sorting) of biblical books by canon order.

bible_reference.NamingScheme

Return an intid for a Biblical book and provide unified human-readable representations.

bible_reference.bible_reference_re()

Return a regular expression object matching Bible references that use names from any of the naming schemes. Ordinals will not be checked (“9.Cor” will match) nor key plausibility (meaning, ambigious naming schemes will yield undefined results).

The resulting regex should match German („1.Kor 2,12“) and English (1Cor 2:12) biblical references. Your milage for English references may vary, for it has not been tested extensively.

bible_reference.BibleReference

Here is where it all comes together. An instance is created using

br = BibleReference(BiblicalBook("Jn"), 3, 16)

or

from bible_reference import BibleReference
from bible_reference.naming_schemes import RGG, Luther84_abbr

br = BibleReference.parse("Joh 3,16", [ Luther84_abbr, RGG, ])

For represenration, the first naming scheme passed to the constructor is used by default.

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

bible_reference-1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

bible_reference-1.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file bible_reference-1.0.tar.gz.

File metadata

  • Download URL: bible_reference-1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.9

File hashes

Hashes for bible_reference-1.0.tar.gz
Algorithm Hash digest
SHA256 7d2a7b90f7108acf42010809f654a147588e8c461b104c8b62cdd4212fb345a9
MD5 c8bb1e0fd44b57b6f4adebd5ec764809
BLAKE2b-256 f5b8340ba06ca04c37c26c707d21c5c9b410ca3e1e7e4db1270418fb34886714

See more details on using hashes here.

File details

Details for the file bible_reference-1.0-py3-none-any.whl.

File metadata

  • Download URL: bible_reference-1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.9

File hashes

Hashes for bible_reference-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a632892a1ef7f7042e90d0a7177f0188e4e96423cac4c40f338a2d7b21cf32d
MD5 f20290fe592bda445bb5756564083f07
BLAKE2b-256 105e559e0290f4e7ebf264c1c241b31eb76bd232ce9f8fc51df4534ad5346d17

See more details on using hashes here.

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