Skip to main content

A Python library for the Ukrainian Bible (Ohienko translation).

Project description

A lightweight, zero-dependency Python library for interacting with the Ukrainian Bible (Ivan Ohienko / Іван Огієнко translation). Designed for developers, researchers, and bot creators who need fast, offline access to biblical texts in Ukrainian.

Features

  • Offline Access: No API keys or internet connection required. The text is embedded in the library.
  • Smart Parsing: Understands various book abbreviations (e.g., "Мт", "Матвія", "Євангелія від Матвія").
  • Range Support: Fetch single verses ("Ів 3:16") or ranges ("Мт 5:3-10").
  • Search: Case-insensitive substring search across the entire text.
  • Random Verses: Perfect for "Verse of the Day" features.

Installation

Install the library via pip:

pip install ukr-bible

Quick Start

1. Fetching Verses

The get() method returns a list of Verse objects.

from ukr_bible import Bible

bible = Bible()

# Get a single verse
verses = bible.get("Івана 3:16")
for v in verses:
    print(f"{v.book_long} {v.chapter}:{v.verse}{v.text}")

# Output:
# Євангелія від Івана 3:16 — Бо так полюбив Бог світ, що дав Сина Свого Однородженого...

2. Fetching a Range

You can request multiple verses at once

# Get the Beatitudes (Matthew 5:3-5)
beatitudes = bible.get("Мт 5:3-5")

for v in beatitudes:
    print(f"[{v.verse}] {v.text}")

3. Searching

Find verses containing specific words or phrases.

# Search for "світло для світу"
results = bible.search("світло для світу")

print(f"Found {len(results)} matches:")
for v in results:
    print(v)

4. Random Verse

Get a random verse from the entire Bible.

random_v = bible.random_verse()
print(f"Random wisdom: {random_v.text} ({random_v.book_short} {random_v.chapter}:{random_v.verse})")

Data Structure

The library returns Verse objects with the following attributes:

  • book_short (str): Abbreviated book name (e.g., "Мт").
  • book_long (str): Full book name (e.g., "Євангелія від Матвія").
  • chapter (int): Chapter number.
  • verse (int): Verse number.
  • text (str): The text of the verse.

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

ukr_bible-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.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ukr_bible-0.1.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for ukr_bible-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c4d4c7a01f47dc810339f865cf86fda6f346c2511e712bedcbd799a57b36a076
MD5 4d4308e32031fa1bbf3ef27119e4d043
BLAKE2b-256 b2dcc596945bfb29b60c2ac004f932c91471d0cd0933737a0691b4a159289bd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ukr_bible-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for ukr_bible-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 036cc6cf09c37f08391eb019ab467c00c569f0b1ba6ae064ebd7e60d4c129545
MD5 896b59f640782533eaa12d71427c0a11
BLAKE2b-256 0a0aba5d48773a5e2b1981d8b47a757900d1f376562a1413d9807c1384add922

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