Skip to main content

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.

There is a directory postgresql/ containing example code on how to use this for sorting biblical references in the a relational database in canonical order. See postgresql/README.md

Metadata

Release files for bible-reference 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bible-reference 1.2
File Size Uploaded
bible_reference-1.2.tar.gz 29.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bible-reference 1.2
File Interpreter ABI Platform
bible_reference-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 66.8 kB

Release files / bible_reference-1.2.tar.gz

Download URL bible_reference-1.2.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c9c07bee3008b80db8f0e1d11222028a27c0bf7d7c14ecebd404add31b5050dd
BLAKE2b-256 checksum
How to use checksums
f351b466c350228582c323a86ad66b7b4157ab2ffcfcb56ca3df385e4acfd3bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / bible_reference-1.2-py3-none-any.whl

Download URL bible_reference-1.2-py3-none-any.whl
Size 37.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5baf086b8be5b0a5b8219f873892e6052ccfb330978653ac9b28eb69169178ee
BLAKE2b-256 checksum
How to use checksums
bec3beab60494a6624b4b689d906c936aaededd15a59f8b72bc02754e2496291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page