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.1
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.1.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lekhaka-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / lekhaka-0.0.1.tar.gz
| Download URL | lekhaka-0.0.1.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
260ec0a42ccaccffc755212bbb707f22b107d26d3e51fcd917fb506d16d88068
|
|
BLAKE2b-256 checksum How to use checksums |
4cd0fae7f7a6ec2a031b13510103efae378ac396545cef64016f12c7c825994b
|
| 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.1-py3-none-any.whl
| Download URL | lekhaka-0.0.1-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9b0f27476912cd90c0821e5ba27ca1883be6028ae97d3c72fd6114334b355ca
|
|
BLAKE2b-256 checksum How to use checksums |
12076ffd92c2d6950e60f171fc8850eb51d719bf334b8ca0887408ad1c69162f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|