Skip to main content

biblehub

A python module and CLI app (Formerly BibleHubScrapper) that retrieve verses and information on those verses from biblehub.

Installation

pip3 install --pre biblehub

Currently beta testing, some bugs must be reworked.

CLI app

Simple Queries

Find verses with no information by using the find command and no flags

biblehub find Matthew 2:4

You can retrieve single verses, a range of verses, or an entire chapter.

Informational Queries

The CLI app is also capable of retrieving information on the queried single verse queries with the optional flags -a (All information) -l (Lexicon) and -t (Treasury of Scripture)

Note: Information is only available for single verse references (i.e Genesis 1:1), multiverse references(i.e Genesis 1:1-2) will not return information on each verse yet.

To only retrieve specific information, pass in the corresponding tag:

biblehub find -c [Reference] # Also retrieves the cross-references
biblehub find -l [Reference] # Also retrieves the lexicon
biblehub find -t [Reference] # Also retrieves the treasury of scripture

As with most CLI tools, arguments can be stacked with one hyphen and the position of the arguments don't matter relative to the verse. All of these are valid queries:

biblehub find -cl [Reference] # Retrieves the cross-references and lexicon in addition to the passage
biblehub find Matthew 2:4 -c

Versioning

To retrieve all the versions for a single verse reference, use the --versions tag

biblehub find --versions Genesis 2:4

To find a specific version (See available verses on biblehub), use the -v tag

biblehub find -v KJV Jam 4:7

Search Queries

To search biblehub use the search command

biblehub search Goliath

Contains optional arguments --ot and --nt to limit the results to the old or new testaments

Script Usage

You can import the query and get_versions methods to use in scripts.

from biblehub import find_verse, get_versions

biblehub_query = find_verse('Genesis 1:1')
all_versions = get_versions('Genesis 1:1')
print(biblehub_query.text) # In the beginning...
print(all_versions[0].passage)

By default, it will query all possible fields. You can choose not to query certain fields by indicating in the parameters for example: find_verse('Genesis 1:1', get_lexicons=False)

Useful fields

print(biblehub_query.passage) # Genesis 1:1
print(biblehub_query.version) # NIV (default)
print(biblehub_query.lexicons) # Text, Hebrew words, translit, strong, and English defintions
print(biblehub_query.crfs) # Cross References
print(biblehub_query.tos) # Treasury of Scripture
print(biblehub_query.info) # Prints all the info queried on the verse. Also the same as the __str__

there are also biblehub_query.format_[field] method that returns the specified field in an easy to read way.

Searching

from biblehub import search as b_search
list = b_search("Goliath", filter='nt')

Known Bugs

  • Because of the way psalms are formatted in biblehub, if you do a multi-verse query for the psalms (i.e Psalms 23:1-5), parts of the verses will be cut off. This problem is not present in single verse queries however
  • If you type in a random version (i.e biblehub -v JOE Matthew 2:4) it will retrieve the NIV by default as expected, but the version in the reference display will still display that unknown version. This can make for some pretty fun images though.

Contributing

If you feel like improving the codebase, adding a feature, or checking my grammar, feel free! checkout the issues I post for tasks you can help with, reference specific issues when making a PR. Make sure to send a pull request against the development branch.

Regrets

This was probably one of the most fun side projects I have worked on, sadly though I am unlikely to continue developing it. I did not begin this with the goal of making it a sustainable project, I only wanted to hash together something to help me whenever I needed to quickly lookup bible references or look at cross-references. For this reason, I did not develop tests earlier on and did not spend a lot of time on making the codebase scalable for different uses. I say all of this just to make this statement:

WRITE TESTS!!! They make life so much easier in the long term

Find this app helpful? Useful? Please let me know at joshua@joshpetit.dev!

Metadata

Release files for biblehub 2.0.1

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

Source distribution (sdist)

Source distribution for biblehub 2.0.1
File Size Uploaded
biblehub-2.0.1.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for biblehub 2.0.1
File Interpreter ABI Platform
biblehub-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / biblehub-2.0.1.tar.gz

Download URL biblehub-2.0.1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f741d23ca7f1dc7a559b5dd66dad669193743496b8bb192e69fe264b86c450e
BLAKE2b-256 checksum
How to use checksums
1c44f7dad3eab9b9c0479cef40e09004822e27c52abd84c702f58a266bc02212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release files / biblehub-2.0.1-py3-none-any.whl

Download URL biblehub-2.0.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90feee40c18e07c32a96c70fd75a01cdd97f67449ad407392f3a5327a7a8d306
BLAKE2b-256 checksum
How to use checksums
1511f37c059dfd322043b9ad2f3910966af4b4e57ff18e612b19be9a93517cd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
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