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.1.tar.gz (943.2 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.1-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qran-1.0.1.tar.gz
  • Upload date:
  • Size: 943.2 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.1.tar.gz
Algorithm Hash digest
SHA256 368ae050dd744048166a3e750997c52372184840bdb4f7402c87f236da6bd320
MD5 eb05a8a58caaeea108ac0bd762fa4f8f
BLAKE2b-256 762452a8e4c90d2a67687179aeaa34f86ac5422c804da582202b82df005d0923

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qran-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea3e9b6db0146b777f5dff53825dffa521c93480ff4afc607d626bbfb2b93e85
MD5 c3147a65c4a3c2d237783b47bd186515
BLAKE2b-256 c5a047af97c2670fb822d58745263fac01585889833de5d38dc01c50bc2b8c8c

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