Skip to main content

ArabCheck 🔍

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

العربية →

PyPI - Version PyPI - Python Version CI GitHub Repo stars License: MIT


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.


Features

  • 🕌 Tashkeel removal — Harakat + Quranic marks
  • 🔤 Character normalization — Alif, Yaa, Hamza, Taa Marbuta
  • 〰️ Tatweel removal — Kashida stretching
  • 🧹 Text cleaning — Whitespace normalization
  • 🔍 Grammar audit — Hamzat qat/wasl detection
  • 📂 File + stdin support
  • 🤖 JSON output for CI/CD
  • 🧩 Extensible

Install

From PyPI (recommended):

pip install arabcheck

From source:

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
# → العربية لغة جميلة

2. Normalize characters

arabcheck "أحمد إبراهيم آمن" --normalize
# → احمد ابراهيم امن

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

3. Audit text

arabcheck "الأمر بالأمر" --audit
# ⚠️ احتمال خطأ: 'الأمر' تبدأ بـ 'ال' + همزة قطع.

4. JSON output

arabcheck "النَّصُّ" --clean --json

Returns:

{
  "input": "النَّصُّ",
  "result": "النص",
  "issues": [],
  "meta": {
    "cleaned": true,
    "normalized": false,
    "audited": false,
    "version": "0.1.0"
  }
}

5. Read from file

arabcheck --file dataset.txt --clean

6. From stdin

cat article.txt | arabcheck --clean

CLI Reference

usage: arabcheck [-h] [-f FILE] [-c] [-n] [-a] [-j] [-q] [-V] [text]
Option Description
-h, --help Show help
-f, --file FILE Read from file
-c, --clean Remove tashkeel, tatweel, extra spaces
-n, --normalize Normalize letters
-a, --audit Audit spelling issues
-j, --json JSON output
-q, --quiet Suppress 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"])

Examples

Full working examples are in the examples/ folder:

Run them:

python examples/clean_dataset.py
python examples/preprocess_for_ai.py

Testing

pip install -e ".[dev]"
pytest

22 tests covering core and CLI — all passing ✅


Roadmap

  • Tashkeel & Tatweel removal
  • Character normalization
  • File + stdin support
  • JSON output
  • Exit codes for CI/CD
  • Grammar audit
  • Extended audit rules
  • Dataset loading (CSV, JSONL)
  • Duplicate detection
  • Text quality statistics

Contributing

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


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.1

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.1
File Size Uploaded Provenance
arabcheck-0.1.1.tar.gz 8.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 15.8 kB

Release files / arabcheck-0.1.1.tar.gz

Download URL arabcheck-0.1.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ff13e76488fa9752fe4f4dfa1241d20106f340dc15080aa96430ad142b5da8ed
BLAKE2b-256 checksum
How to use checksums
40d30d96674177002ba226ad8de7a586f52456e2566c7546b0a979d6215c3687
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.1-py3-none-any.whl

Download URL arabcheck-0.1.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbde775fcd7d24747538556a0bb0a6fd830b699d74a5ed7f95166ba05f3f3e15
BLAKE2b-256 checksum
How to use checksums
ed4b6da85f269172dbf17f8d7c8f879c53818e0aaa25bd33ad0de38e5ffa3712
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.1

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.1.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.1 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