Skip to main content

Explore the Bible by verse or by meaning — with multi-version and AI topic search

Project description

📖 bbible

bbible is a lightweight and extensible Python library for Bible verse access and exploration — combining classic reference lookups with AI-powered semantic topic search.

It helps you retrieve verses by book/chapter/verse, or discover scriptures related to concepts like hope, peace, or grace, using transformer embeddings.


✨ Features

  • 🔍 Get verses by reference (single or range)
  • 🧠 Semantic topic search – find verses that match meaning, not just keywords
  • 📚 Multi-version support – supports nkjv, kjv, and others via JSON
  • 💬 Formatted output – reader-friendly for display or printing
  • 📦 Local-first design – no API calls, 100% offline

📦 Installation

pip install bbible

To enable semantic search

pip install sentence-transformers tqdm

🧪 Basic Usage

🔹 Get books and versions

import bbible

print(bbible.get_books())      # List all 66 Bible books
print(bbible.get_versions())   # Available versions (e.g. nkjv, kjv)

🔹 Get a verse or range

print(bbible.get_verse("john", 3, 16))

print(bbible.get_verse("psalms", 23, (1, 6), version="kjv"))

🔥 Semantic Topic Search

Use .topic() to explore verses that relate to a theme or concept, not just a keyword.

print(bbible.topic("hope"))

print(bbible.topic("faith in hard times", version="kjv", top_k=5))

🧠 How it works

  • Verse texts are converted into embeddings using sentence-transformers
  • Your query is embedded and compared to all verses
  • Verses are ranked by cosine similarity to your concept
Input: "grace"
→ Matches: forgiveness, love, undeserved mercy, etc.

✅ Works per version (e.g., NKJV, KJV) for theological clarity.

🔍 Bible Structure

All supported versions use the same format:

{
  "genesis": {
    "1": {
      "1": "In the beginning God created...",
      "2": "And the earth was without form..."
    },
    "2": {
      "1": "Thus the heavens and the earth..."
    }
  },
  ...
}

📘 Sample Output

print(bbible.topic("peace", version="nkjv", top_k=2))
        You will keep him in perfect peace, whose mind is stayed on You, because he trusts in You.
Isaiah 26:3 NKJV

        Peace I leave with you, My peace I give to you; not as the world gives do I give to you.
John 14:27 NKJV

from bbible by Biyi

🧰 API Reference

🔹 get_books() → list

Returns all 66 books of the Bible.

🔹 get_versions() → list

Returns a list of available Bible versions (based on loaded JSONs).

🔹 get_verse(book, chapter, verse, version="nkjv")

Returns a verse or range (tuple) formatted with or without attribution.

🔹 topic(query, version="nkjv", top_k=5, tag=True)

Performs semantic search. Returns verses most related to the query.


📄 License

MIT License © Biyi Adebayo
Built with ❤️ and the Word.

🌐 Project Links

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

bbible-0.2.1.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

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

bbible-0.2.1-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file bbible-0.2.1.tar.gz.

File metadata

  • Download URL: bbible-0.2.1.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for bbible-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a660836ea7703c3b2f51f84fadd4c9d0bb7f28f2c9d200fd4628185fa5492e36
MD5 28eb6f64c36ea3dbafce376c9d2fe35a
BLAKE2b-256 fbcfe59ed4ca8729b6cfe45688f69c97bbeef12e4af83105b4d20b5295566740

See more details on using hashes here.

File details

Details for the file bbible-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bbible-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for bbible-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 493923278f16ff21feafb6927131dada0379e632ce09162a49a7c770a456dc97
MD5 930e136d3da530e6bf6ba4797a8efee1
BLAKE2b-256 ef4f3249a79978ece53fb4ab91b6f36e4ab7c9adf969b391a832287fb6072a5d

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