Skip to main content

ArabCheck 🔍

A lightweight, open-source toolkit and CLI for cleaning, normalizing, and auditing Arabic text for AI and NLP workflows.

Python License Status


Why ArabCheck?

Arabic text data often contains noise that breaks NLP pipelines:

  • Unicode variants — أ / إ / آ / ا / ٱ all represent alif
  • Diacritics (Tashkeel) — fatha, damma, shadda, tanween
  • Tatweel (Kashida) — decorative stretching characters ـــــ
  • Quranic marks and extra whitespace

ArabCheck makes cleaning and auditing this data a one-liner — with full transparency and configurable operations.


Features

  • 🕌 Tashkeel removal — Harakat + Quranic marks
  • 🔤 Character normalization — Alif, Yaa, Hamza, Taa Marbuta
  • 〰️ Tatweel removal — Kashida stretching characters
  • 🧹 Text cleaning — Whitespace normalization
  • 🔍 Grammar audit — Detect common hamzat qat/wasl errors
  • 📂 File + stdin support
  • 🤖 JSON output for CI/CD pipelines
  • 🧩 Extensible — easy to add new rules

Install

git clone https://github.com/MOHAMEDKAMALSALLIH/arabcheck.git
cd arabcheck
pip install -e .

Requirements: Python 3.8+ — no external dependencies.


Quick Start

arabcheck "النَّصُّ العَرَبِيُّ لِلتَّجْرِبَة" --clean

Input:

النَّصُّ العَرَبِيُّ لِلتَّجْرِبَة

Output:

النص العربي للتجربة

Usage Examples

  1. Clean text
arabcheck "العَرَبِيَّةُ ـــ لُغَةٌ جَمِيلَةٌ" --clean
# → العربية لغة جميلة
  1. Normalize characters
arabcheck "أحمد إبراهيم آمن" --normalize
# → احمد ابراهيم امن

⚠️ Warning: Normalization loses linguistic information. Use it for search, indexing, or NLP pipelines only.

  1. Audit text
arabcheck "الأمر بالأمر" --audit
# ⚠️  احتمال خطأ: 'الأمر' تبدأ بـ 'ال' + همزة قطع.
  1. JSON output (for automation)
arabcheck "النَّصُّ" --clean --json
{
  "input": "النَّصُّ",
  "result": "النص",
  "issues": [],
  "meta": {
    "cleaned": true,
    "normalized": false,
    "audited": false,
    "version": "0.1.0"
  }
}
  1. Read from file
arabcheck --file dataset.txt --clean
  1. From stdin
cat article.txt | arabcheck --clean

CLI Reference

usage: arabcheck [-h] [-f FILE] [-c] [-n] [-a] [-j] [-q] [-V] [text]

positional arguments:
  text                  Text to process

options:
  -h, --help            Show help
  -f, --file FILE       Read text from file
  -c, --clean           Remove tashkeel, tatweel and extra whitespace
  -n, --normalize       Normalize letters (alif, yaa, etc.)
  -a, --audit           Audit common spelling issues
  -j, --json            Output as JSON
  -q, --quiet           Suppress text output
  -V, --version         Show version

Exit Codes

Code Meaning 0 Success, no issues 1 Issues found (with --audit) 2 Input error


Use as a Library

from arabcheck import ArabCheck

checker = ArabCheck()

# Clean
text = checker.clean_text("النَّصُّ العَرَبِيُّ ـــ")
print(text)  # → النص العربي

# Normalize
print(checker.normalize("أحمد إبراهيم"))
# → احمد ابراهيم

# Audit
issues = checker.audit("الأمر بالأمر")
for issue in issues:
    print(issue["message"])

Testing

pip install -e ".[dev]"
pytest

Roadmap

☑ Tashkeel & Tatweel removal ☑ Character normalization ☑ File + stdin support ☑ JSON output ☑ Exit codes for CI/CD ☑ Grammar audit (hamzat qat/wasl) ☐ Extended audit rules ☐ Dataset loading (CSV, JSONL) ☐ Duplicate detection ☐ Text quality statistics ☐ Publish on PyPI


Contributing

Contributions, issues, and feature requests are welcome! See CONTRIBUTING.md for guidelines.


Releases

See Releases for version history.


License

MIT — see LICENSE for details.


Made with ❤️ for the Arabic NLP community

Metadata

Release files for arabcheck 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arabcheck 0.1.0
File Size Uploaded Provenance
arabcheck-0.1.0.tar.gz 7.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for arabcheck 0.1.0
File Interpreter ABI Platform
arabcheck-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / arabcheck-0.1.0.tar.gz

Download URL arabcheck-0.1.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9db3e23c9d72af2e4ee9c95f333f870dd897aa3aa5aecc0dfc38253c271f66c8
BLAKE2b-256 checksum
How to use checksums
4cfdd3a438536792f50396d46daabff4ea4be84bd01573891fd6384605eb6224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / arabcheck-0.1.0-py3-none-any.whl

Download URL arabcheck-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bd59524d41c31c2a26f1275dcdc39e201651b0003e4c011396b8725df68741c
BLAKE2b-256 checksum
How to use checksums
c648aa3a5df36a09f00b8cfdc1fe87659f36b950c2de8da52d7359ce97af51e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Security for arabcheck 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for arabcheck-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page