lekhaka
lekhaka (लेखक, a scribe) turns a printed book of verses into its chapters. Each page is read by a vision model through vishalakshi, local or hosted, as blocks: verses with their printed numbers, headings, colophons. lekhaka gathers the verses into chapters, mends the numbering slips a reader makes, repairs malformed Devanagari akṣaras, and lists what a proofreader should check.
Install
pip install lekhaka
How to use
from lekhaka import read_book, book_md
from vishalakshi import Vault
b = read_book('gita.pdf', Vault('books.db'), model='claude/sonnet', title='Bhagavad Gita',
hint='Each verse ends in ॥ n ॥.', counts=[47, 72])
b.chapters[0]['verses'][:2] # [{n, text, page, heading}, ...]
b.probs # numbers mended, counts that differ, for a proofreader
print(book_md(b.chapters, 'Bhagavad Gita'))
With a vault the pages are kept as versions of one document: vault.proofread(b.doc_id, readers) has other models read them again, and vault.accept applies the changes the owner chooses. Without a vault nothing is stored.
The pieces work on their own, on the pages vishalakshi.read_doc returns or any {page, blocks} list:
chs, probs = assemble([dict(page=0, blocks=[dict(kind='verse', n='॥१॥', text='क ॥१॥'), dict(kind='verse', n='३', text='ख ॥३॥')])])
[v['n'] for v in chs[0]['verses']], probs
fix_aksharas('ध्ार्म'), vnum('२६॥२७')
Metadata
Release files for lekhaka 0.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 | |
|---|---|---|---|
| lekhaka-0.0.2.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lekhaka-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / lekhaka-0.0.2.tar.gz
| Download URL | lekhaka-0.0.2.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
445581e0dca798bf6fef598824e274c0c57da3434f1fa824def735dd83e9c4a9
|
|
BLAKE2b-256 checksum How to use checksums |
e55a1b2e5f9cdc009f2a08c30c6644b7d554df3f0103364f0a718f31eb959ba6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / lekhaka-0.0.2-py3-none-any.whl
| Download URL | lekhaka-0.0.2-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e7b54451073c9f7929110f0ab0dd0928c2aef5499c0f90aa1c94aba67bad6cd
|
|
BLAKE2b-256 checksum How to use checksums |
30c21078b4aa6c581f270c9fa60616f8d70bd37d4a983cf9a2efe280bb835924
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|