Skip to main content

python-bible

This python library serves several purposes related to the Christian Bible and Scripture references.

Test

Installation

pip install python-bible

Features

Searching text for scripture references

Given a text, search for scripture references and return any that are found in a list of tuples.

For example, given the following text:

import pybible

text = "The parable of the lost sheep is told in Matthew 18:12-14 and Luke 15:3-7."
references = pybible.get_references(text)

The search functionality should return the following list of scripture reference tuples:

[(<Book.MATTHEW: 40>, 18, 12, 18, 14), (<Book.LUKE: 42>, 15, 3, 15, 7)]

Converting a normalized scripture reference into a list of integer verse ids

Any single verse can be identified by an integer that contains the book, chapter, and verse information. The first 1-2 digits of the integer id represent the book, the next 3 digits represent the chapter, and the last 3 digits represent the verse.

For example, "Genesis 1:1" would be represented as:

1001001

"John 3:16" would be represented as:

43003016

The book of John is the 43rd book of the Bible, "003" represents the 3rd chapter, and "016" represents the sixteenth verse.

Since the book, chapter, and verses are standardized and unlikely to change, this allows us to reference verses in a very efficient way.

Given a normalized scripture reference, which can contain one or more verses, the conversion functionality will convert that normalized scripture reference tuple into a list of verse id integers.

For example, given the following normalized scripture reference for Genesis 1:1-4:

import pybible

reference = (pybible.Book.GENESIS, 1, 1, 1, 4)
verse_ids = pybible.convert_reference_to_verse_ids(reference)

The conversion functionality would return the following list of verse id integers:

[1001001, 1001002, 1001003, 1001004]

Converting a list of verse id integers into a list of normalized scripture reference tuples

The reverse of the above feature, we can take a list of integer verse ids and convert it back into a list of normalized scripture reference tuples.

For example, the following list of verse ids represent the references Matthew 18:12-14 and Luke 15:3-7.

import pybible

verse_ids = [40018012, 40018013, 40018014, 42015003, 42015004, 42015005, 42015006, 42015007, ]
references = pybible.convert_verse_ids_to_references(verse_ids)

The conversion functionality would return the following list of normalized scripture reference tuples.

[(<Book.MATTHEW: 40>, 18, 12, 18, 14), (<Book.LUKE: 42>, 15, 3, 15, 7)]

Converting a list of normalized scripture reference tuples into a formatted string scripture reference

coming soon...

Given a list of verse id integers, formatting the related Biblical text for print or web display in one or more open source or public domain versions

coming soon...

Download files

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

Source Distribution

pythonbible-0.0.1.tar.gz (91.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythonbible-0.0.1-py3-none-any.whl (83.2 kB view details)

Uploaded Python 3

File details

Details for the file pythonbible-0.0.1.tar.gz.

File metadata

  • Download URL: pythonbible-0.0.1.tar.gz
  • Upload date:
  • Size: 91.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for pythonbible-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f8d2bf07e2c64f74cffdc5259077b5d637b947883f122dfdd41c353813a03ca3
MD5 da98e34353ffefc56be63eb035d0a1f6
BLAKE2b-256 49d8827b853114b50a0e1c6ff31d6442172cc0f9ecc8756d7f3aeea9ee7b8862

See more details on using hashes here.

File details

Details for the file pythonbible-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pythonbible-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 83.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for pythonbible-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27c0b91e42f392e7841e27cb43a3e4e9501c3e3bfd04a028643abd68d8505ce6
MD5 7e6ec89c3f817665f3c29df127e78b61
BLAKE2b-256 8e6feae7e1c28aaf1f7c737e3266c542095429c3d5f6b7ad5e5237c38717f9e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page