Skip to main content

Access Bibles using versiref

Project description

VersiRef Bible

VersiRef is a Python package for sophisticated parsing, manipulation, and printing of references to the Bible.

versiref-bible provides access to Bibles in an SQLite-based format: ranges of verses can be retrieved by reference, and verse text can be searched with SQLite FTS5. VersiRef parses the references and handles versification.

The command-line interface is designed for use by an LLM: output is compact plain text, one verse per line as reference⇥text (TAB-separated).

Documentation

Installation

uv sync

This installs the versiref-bible command into the project environment (run it with uv run versiref-bible …).

Commands

build — create a database from a text file

Reads a CCAT-format .cat file where each line is Abbrev C:V text (the abbreviation is a BibleWorks-style book name) and writes an SQLite database. Each verse is stored as one row, keyed by an integer verse key computed under the chosen versification, plus an FTS5 index over the verse text. CCAT footnotes/formatting are kept as plain text for now.

uv run versiref-bible build BIBLE.cat --versification eng --title "My Bible"

Options:

  • -v, --versification (required) — named versification of the Bible (eng, lxx, cei, …).
  • -o, --output — database path (default: input name with a .db suffix).
  • --title — human-readable title stored in the database.
  • --book-style — reference style whose names map the file's abbreviations (default en-bibleworks).
  • --encoding — input text encoding (default utf-8; the CEI sample needs cp1252).

Lines whose book abbreviation is unrecognized (e.g. the Sirach prologue Sip), or whose book is absent from the chosen versification, are skipped with a warning on stderr.

show — print the verses of a reference

uv run versiref-bible show BIBLE.db "John 3:16-18"
  • --style — reference style for parsing the input and labelling output (default en-sbl).
  • --from-versification — interpret the reference in this versification and map it to the database's versification.

The reference is parsed in the style you choose, so use that style's conventions (e.g. --style it-cei expects Gen 1,1-3, not Gen 1:1-3).

search — full-text search verse text

uv run versiref-bible search BIBLE.db "living water" --limit 10

QUERY uses SQLite FTS5 syntax (e.g. light, "living water", love AND world). Results are in canonical verse order by default.

  • -n, --limit — maximum verses to return (default 20).
  • --in — restrict the search to a reference (e.g. --in "Gen 1", --in "John").
  • --ordercanonical (default, verse order) or relevance (bm25 ranking).
  • --style — reference style for labelling output and parsing --in (default en-sbl).

info — show database metadata

uv run versiref-bible info BIBLE.db

Prints the stored metadata (title, versification, source, build time, …) and the verse count.

Development

uv run pytest        # tests
uv run ruff check    # lint
uv run mypy src      # type-check

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

versiref_bible-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

versiref_bible-0.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file versiref_bible-0.1.0.tar.gz.

File metadata

  • Download URL: versiref_bible-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for versiref_bible-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b3a155de2d60402c4011238051fd89aac751deddd5a6c2653cb63d7c796541cb
MD5 f2bfb1c8b8903973e22602dd559d1992
BLAKE2b-256 bffc64a529b120e4185784cadeb248828eaad92235188b0c4eb75ba2c6a3b7e5

See more details on using hashes here.

File details

Details for the file versiref_bible-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: versiref_bible-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for versiref_bible-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a14c462a680fcfa52c753a39060238b91a79858e8ade50fa3eee52c39cf29a0
MD5 9d76af851e95ea0c0f89a9114fd654df
BLAKE2b-256 5c700f8047aca4aad7d974fb6c5933af8029620fdf4e3d8ce77d4c31e77fdb9b

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