Skip to main content

A CLI tool to look up Bible verses locally.

Project description

grepbible

grepbible is a command-line interface (CLI) tool designed to make searching for Bible verses (in ca. 60 languages) locally (like grepping) and looking up the Bible quotes fast and intuitive.
It also represents a new channel for Bible distribution and aids in language learning, as parallel Bible translations have been used for centuries to learn languages.

Wikipedia article on Bible citations
The raw text is taken from Wordproject®, and has undergone processing to fit the specific needs and format of this project.

There's a serparate project for the web UI: grepbible-server. Its demo is available at langtools.io/gb

Features

  • Search Capabilities: Look up individual verses, ranges of chapters, or specific passages across multiple translations.
  • Multiple Bible Versions: Easily switch between different Bible translations to compare interpretations and wording.
  • Local Caching: Bible versions are downloaded and stored locally for quick access and offline use.
  • Parallel and interleave text: Combine text blocks from different translations.

Installation

To install grepbible, ensure you have Python 3.9 or higher installed on your system. You can install grepbible directly from PyPI:

pip install grepbible

This command installs the grepbible package and makes the gbib command available in your shell.

You might need to update your PATH as well (e.g. on Ubuntu):

export PATH=$PATH:$(python3 -m site --user-base)/bin

and add it to ~/.bashrc to make it persistent

demo

Usage

grepbible is designed to be straightforward and easy to use from the command line. The default version (unless the flag -v is specified) is 'kj' (KJV), in English.

Below are some common usage examples:

Look Up a Single Verse

gbib -c "John 3:11"
Verily, verily, I say unto thee, We speak that we do know, and testify that we have seen; and ye receive not our witness.

Compare Verses in Different Translations

gbib -v kj,pl -c "Romans 8:20"
For the creature was made subject to vanity, not willingly, but by reason of him who hath subjected the same in hope,

Gdyż stworzenie marności jest poddane, nie dobrowolnie, ale dla tego, który je poddał,

Lookup a Chapter

gbib -c 'Psalms 117'
O Praise the LORD, all ye nations: praise him, all ye people.
For his merciful kindness is great toward us: and the truth of the LORD endureth for ever. Praise ye the LORD.

Show a Range of Verses

gbib -c "Gen 41:29-30"
Behold, there come seven years of great plenty throughout all the land of Egypt:
And there shall arise after them seven years of famine; and all the plenty shall be forgotten in the land of Egypt; and the famine shall consume the land;

Fetch Multiple Disjoint Verses

gbib -c "Genesis 1:1,3"

Compare different versions

Show interleave translation of Latin Vulgata to English KJV (line-by-line):

gbib -c 'Gen 41:29-30' -v kj,vg -i

Compare different versions line-by-line

Block-by block translation (omit the flag -i):

 gbib -c 'Gen 41:29-30' -v kj,vg 
Behold, there come seven years of great plenty throughout all the land of Egypt:
And there shall arise after them seven years of famine; and all the plenty shall be forgotten in the land of Egypt; and the famine shall consume the land;

ecce septem anni venient fertilitatis magnae in universa terra Aegypti
quos sequentur septem anni alii tantae sterilitatis ut oblivioni tradatur cuncta retro abundantia consumptura est enim fames omnem terram

Random quotes

Time for some fun! One can generate random quotes (in different languages and in parallel as well).

gbib -r

demo

Get help

For more information on command options and additional features, you can run:

gbib --help

demo

Use with grep

One can literally use grep to look up the verses and leverage gbib only for downloading the sources. Here's how.

First, download KJV ('kj') and Vulgata ('vg'). The data is stored in $HOME/grepbible_data, thus, it makes sense to store it as a variable, e.g. the path to the 5th chapter of Exodus in KJV will be $HOME/grepbible_data/kj/Exodus/5.txt

gbib -d kj,vg
export GB=$HOME/grepbible_data/kj

Go to line

Example, jump 10th line of 5th chapter in Exodus:

less +10 $GB/Exodus/5.txt

Count occurences of words

How often the word 'camel' appears in the Bible:

grep -nr $GB -e camel | wc -l # 59

What was this quote about the sheep and wolves?

grep -nr $GB -e wolves | grep sheep

local grep

Fuzzy search

The -s option enables fuzzy search, which is helpful when you're not sure about the exact wording or struggling with the grammar of archaic language:

gbib -s 'I was delivered to my strong enemy'
~/grepbible_data/kj/Psalms/18.txt:17:He delivered me from my strong enemy, and from them which hated me: for they were too strong for me.
~/grepbible_data/kj/2 Samuel/22.txt:18:He delivered me from my strong enemy, and from them that hated me: for they were too strong for me.

Contributing

Contributions to grepbible are welcome! Whether it's improving code, or reporting issues, or spreading the word, or financial support, your input is valuable.

Issues/bugs

To raise an issue, go to 'Issues' tab, and click on 'New issue'.

Code

To contribute code:

  1. Fork the repository.
  2. Create a new branch for your feature or fix.
  3. Commit your changes with clear, descriptive messages.
  4. Push your branch and submit a pull request.

Please ensure your code adheres to the project's style and quality standards. For major changes, please open an issue first to discuss what you would like to change.

Social

Feel free to spread the word or/and use the hashtag #grepbible in social media.

Financial

Feel free to buy me a coffee: ko-fi

License

grepbible is open-source software licensed under the MIT License. See the LICENSE file for more details.

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

grepbible-0.3.2.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

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

grepbible-0.3.2-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file grepbible-0.3.2.tar.gz.

File metadata

  • Download URL: grepbible-0.3.2.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for grepbible-0.3.2.tar.gz
Algorithm Hash digest
SHA256 7c44341591c658a6f4bf202c00799e70e8d86a58b9c0dd9e0e8ba6858a885932
MD5 8d0783dc2c3b859ac8185d7185956710
BLAKE2b-256 adbd746f40cc4411a07bbf5bd0ea5bde987114b08d23f02fb25ae34f9d61e3fc

See more details on using hashes here.

File details

Details for the file grepbible-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: grepbible-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for grepbible-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c9a0c54b729c889613294fe9d10488a5f11810b7932d49eb278b1de13e8c39a1
MD5 56abbdaf7855cab335f82e684da17193
BLAKE2b-256 4d89186918e6145775739c387818d0ebd1ba1619cb3fa24756c49d29280d8d91

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 Pingdom Monitoring Sentry Error logging StatusPage Status page