Skip to main content

Quran text API

Project description

qran

Quran structured text API.

Python package to extract Quranic text in graphemic and archigraphemic representations, different Quranic encodings and Latin transliteration. The package works as a an API for the stuctured Quran.

This package can be very helpful for semiautomating the transcription of old Quranic manuscripts or fast lookups of script and typographic analysis.

Installation

pip install qran

Usage

As a python library

from qran import get_text, Index

>>> text = get_text(
...     ini_index=Index(sura=1, verse=1, word=4, block=2),
...     end_index=Index(sura=1, verse=2, word=2, block=-1),
...     args={"blocks": True},
... )
... 
>>> for grapheme_ar, grapheme, lt, archigrapheme_ar, arhigrapheme_lt in text:
...     print(grapheme_ar, grapheme, lt, archigrapheme_ar, arhigrapheme_lt)
...     
لرَّ LRᵚᵃ لر LR 1:1:4:2
حِيمِ GᵢBMᵢ حٮم GBM 1:1:4:3
ا A ا A 1:2:1:1
لْحَمْدُ LᵒGᵃMᵒDᵘ لحمد LGMD 1:2:1:2
لِلَّهِ LᵢLᵚᵃHᵢ لله LLH 1:2:2:1

Alternatively, you can use a tuple of integers instead of an Index object:

>>> text = get_text(
...     ini_index=(1, 1, 4, 2),
...     end_index=(1, 2, 2, -1),
...     args={"blocks": True},
... )

As a unix-like command:

$ qran 1:1:4:2-1:2:2 --blocks
لرَّ	LRᵚᵃ	لر	LR	1:1:4:2
حِيمِ	GᵢB₂Mᵢ	حٮم	GBM	1:1:4:3
ا	A	ا	A	1:2:1:1
لْحَمْدُ	LᵒGᵃMᵒDᵘ	لحمد	LGMD	1:2:1:2
لِلَّهِ	LᵢLᵚᵃHᵢ	لله	LLH	1:2:2:1

License

This project is licensed under the MIT License for its source code.

It includes Quran text from the Tanzil Project, which is licensed under the Creative Commons Attribution 3.0 License.

© 2007–2021 Tanzil Project. The text is unmodified and used under Tanzil's terms of use: http://tanzil.net/docs/license

Author

Alicia González Martínez

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

qran-1.0.0.tar.gz (942.4 kB view details)

Uploaded Source

Built Distribution

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

qran-1.0.0-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file qran-1.0.0.tar.gz.

File metadata

  • Download URL: qran-1.0.0.tar.gz
  • Upload date:
  • Size: 942.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for qran-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6c9e9f8e2779b5ea67ca73d0f4f7fc917cdc4e0105d43bff668a5e7d6e1e0189
MD5 a2212edd665eeafe184ac8830b7c9e86
BLAKE2b-256 bc3912b3e38d78c9db7846101535cf6933486b87cd13638dfcc1be380d604a42

See more details on using hashes here.

File details

Details for the file qran-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: qran-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for qran-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a35dbe4f86095f477103de732297aec815a5c6aa4d259c02ab9c1c87197786c
MD5 c650b1b0f6a204ace899fa4ae5606ab0
BLAKE2b-256 84c04c13a75ac2618fb066fe1e05fb57d4b1dd2a2db53ff020d04f19fd576227

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