acdh-bible-pyutils
Utility functions for dealing with biblicial references
install
pip install acdh-bible-pyutils
or
uv add acdh-bible-pyutils
use
get bible book from biblical reference
from acdh_bible_pyutils import get_book_from_bibl_ref, BIBLE_BOOK_LOOKUP
book = get_book_from_bibl_ref("Lk. 19,41")
print(book)
>>> {"order": 51, "title_eng": "Luke", "title_deu": "Lukas", "title_lat": "Lucas"}
bible_refs = [
"Lk. 19,41",
"Mt. 27,52",
"2 Kings 2:23-24",
"4 Reg. 2,23",
"2 Sam. 6,16",
"88Sam 6,16",
]
for x in bible_refs:
book = get_book_from_bibl_ref(x)
print(f"{x} resolves to: **{book["title_lat"]} / {book["title_deu"]}**, order-nr: {book["order"]}")
>>> Lk. 19,41 resolves to: **Lucas / Lukas**, order-nr: 51
>>> Mt. 27,52 resolves to: **Matthaeus / Matthäus**, order-nr: 49
>>> 2 Kings 2:23-24 resolves to: **2 Regum / 2. Könige**, order-nr: 12
>>> 4 Reg. 2,23 resolves to: **4 Regum / 4. Könige**, order-nr: 14
>>> 2 Sam. 6,16 resolves to: **2 Samuel / 2. Samuel**, order-nr: 10
>>> 88Sam 6,16 resolves to: **88Sam 6,16 / 88Sam 6,16**, order-nr: 0
BIBLE_BOOK_LOOKUP["Lk"]
>>> {"order": 51, "title_eng": "Luke", "title_deu": "Lukas", "title_lat": "Lucas"}
normalize biblical references
from acdh_bible_pyutils import normalize_bible_refs
bible_refs = [
"Lk. 19,41-50",
"Mt. 27,52",
"2 Kings 2:23-24",
"4 Reg. 2,23",
"2 Sam. 6,16",
"88Sam 6,16",
]
for x in bible_refs:
print(normalize_bible_refs(x))
>>> {"order": 51, "title_eng": "Luke", "title_deu": "Lukas", "title_lat": "Lucas", "chapter": 19, "verse_start": 41, "verse_end": 50}
>>> {"order": 49, "title_eng": "Matthew", "title_deu": "Matthäus", "title_lat": "Matthaeus", "chapter": 27, "verse_start": 52, "verse_end": 0}
>>> {"order": 12, "title_eng": "2 Kings", "title_deu": "2. Könige", "title_lat": "2 Regum", "chapter": 2, "verse_start": 23, "verse_end": 24}
>>> {"order": 14, "title_eng": "4 Kings", "title_deu": "4. Könige", "title_lat": "4 Regum", "chapter": 2, "verse_start": 23, "verse_end": 0}
>>> {"order": 10, "title_eng": "2 Samuel", "title_deu": "2. Samuel", "title_lat": "2 Samuel", "chapter": 6, "verse_start": 16, "verse_end": 0}
>>> {"order": 0, "title_eng": "88Sam 6,16", "title_deu": "88Sam 6,16", "title_lat": "88Sam 6,16", "chapter": 88, "verse_start": 0, "verse_end": 0}
## build
```shell
uv build
cheat sheet
sort imports
ruff check --select I --fix
format files
ruff format
run tests
uv run pytest
Metadata
Release files for acdh-bible-pyutils 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acdh_bible_pyutils-0.2.tar.gz | 6.2 kB | Without provenance | Details for acdh_bible_pyutils-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acdh_bible_pyutils-0.2-py3-none-any.whl | Python 3 | none | any | Details for acdh_bible_pyutils-0.2-py3-none-any.whl |
Total release size: 12.6 kB
Release files / acdh_bible_pyutils-0.2.tar.gz
| Download URL | acdh_bible_pyutils-0.2.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7069c37df4755210ac6624ae86514e9d8ad57697dc0dea3269e79b60447a1607
|
|
BLAKE2b-256 checksum How to use checksums |
df683dafed6f178e49d2e7b0425742913b7768bfba8b1c255aa12874211859a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Release files / acdh_bible_pyutils-0.2-py3-none-any.whl
| Download URL | acdh_bible_pyutils-0.2-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c6486eaa602a1052f511c3179dd614378bfe2aef4ba60991f88825f0e82a3b1
|
|
BLAKE2b-256 checksum How to use checksums |
f249fc20f3a6a94544b17a2f021852f53ecc8087bee6e9f62bf9438898da81ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Security for acdh-bible-pyutils 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.