Skip to main content

RÚF Biblia — Revideált új fordítás (Hungarian Reformed Bible) library

Project description

biblia-ruf (Python)

Python port of biblia-ruf — the Hungarian RÚF Biblia (Revideált új fordítás). Passage lookup, full-text search, book metadata, and a deterministic daily verse.

The full Bible text is bundled inside the package, so it works completely offline — no filesystem layout or network access required. Output is byte-for-byte compatible with the JavaScript package (verified by parity tests), so a Python backend and a JS frontend return the same daily verse and search results for the same inputs.

Install

pip install biblia-ruf

Import name is biblia_ruf:

import biblia_ruf

Usage

from biblia_ruf import (
    get_bible_passage,
    search_bible,
    get_daily_verse,
    get_book_details,
    get_bible_books,
)

# Passage lookup — single verse, range, comma list, whole chapter, multi-passage.
get_bible_passage("Jn 3:16")
# [BibleVerse(verse="16", text="Mert úgy szerette Isten a világot…")]

get_bible_passage("Zsolt 139:23-24")
get_bible_passage("Zsolt 100")            # whole chapter

# Full-text search (query is a regular expression).
search_bible("szeretet", limit=10)
search_bible("Isten", testament="old", limit=5)
search_bible("kegyelem", book="Róm")

# Deterministic verse of the day (same date → same verse).
get_daily_verse()
from datetime import date
get_daily_verse(date(2025, 12, 25))

# Book metadata and lists.
get_book_details("Zsolt")                 # BookDetails(name="A Zsoltárok könyve", chapters=150, …)
len(get_bible_books())                    # 66

API

Function Returns Notes
get_bible_passage(passage) list[BibleVerse] Uses the first reference in the string.
search_bible(query, *, testament=None, book=None, case_sensitive=False, limit=100) list[SearchResult] query is a regex; results in canonical book order.
get_daily_verse(target=None) DailyVerseResult target is a date/datetime; defaults to today.
get_book_details(book) BookDetails book is a Hungarian abbreviation, e.g. "Zsolt".
get_bible_books() / _old_testament() / _new_testament() list[BibleBook] 66 / 39 / 27 books.
parse_passage(passage) list[ParsedPassage] Reference parser.
validate_book(abbr) / validate_all_books() list[ValidationError] Data-integrity checks.

All return types are frozen dataclasses exported from the package root. Book abbreviations are the Hungarian toc3 forms (1Móz, Zsolt, Jn, Róm, …) and are matched case-sensitively, matching the JS package.

Development

Requires Python 3.10+ and uv.

uv sync                        # create the venv and install dev deps
uv run ruff check .            # lint
uv run ruff format --check .   # format check
uv run pytest                  # run tests (incl. JS parity)

Refreshing the bundled data

When the upstream Hungarian text is corrected, re-vendor the JSON from the JS repo:

python scripts/sync_data.py --source ../biblia-ruf/json   # from a local checkout
python scripts/sync_data.py --from-github                 # or download from GitHub

Regenerating parity fixtures

tests/golden/ is produced by running the JS package over a fixed set of inputs. After an intentional behavior change, regenerate it against a local biblia-ruf checkout:

BIBLIA_JS_DIST=../biblia-ruf/dist/index.mjs node scripts/gen_golden.mjs

Releasing

Publishing to PyPI is automated via GitHub Actions trusted publishing (OIDC — no API tokens). One-time setup on pypi.org: add a pending publisher for project biblia-ruf pointing at repo kulcsarrudolf/biblia-ruf-py, workflow release.yml (leave the environment field blank). Then cut a release by pushing a tag:

git tag v0.1.0
git push origin v0.1.0

The release.yml workflow builds the sdist + wheel and publishes them to PyPI.

License

MIT — see LICENSE.

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

biblia_ruf-0.1.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

biblia_ruf-0.1.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biblia_ruf-0.1.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for biblia_ruf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 633f61eafd29197f8688109a5b164099500af969d752cd36b3e0d4dbd8b70330
MD5 16f05133a82a9b00d86c82f5d975e058
BLAKE2b-256 4091d8ee2476250246e73903bfe88f7d78f147fd80d084f06fa26137791c08d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for biblia_ruf-0.1.0.tar.gz:

Publisher: release.yml on kulcsarrudolf/biblia-ruf-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: biblia_ruf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for biblia_ruf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f06e61db2970128659e54812bb214e9d724f70a2135af750bff0fb07b1561907
MD5 2deaecb9770360bc53fcdff6f3b1a9b5
BLAKE2b-256 7bb21cf1519dd4369704ff6627e52b3ae2cbfabe9a53016a39bab8eda938a75c

See more details on using hashes here.

Provenance

The following attestation bundles were made for biblia_ruf-0.1.0-py3-none-any.whl:

Publisher: release.yml on kulcsarrudolf/biblia-ruf-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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