Bayanat Labs Arabic PII Pack for Presidio
arabic-pii-pack adds Arabic and Gulf personal-data recognisers to Microsoft Presidio and redacts what they find in Arabic and Arabic-English text. Rule-based recognisers find Saudi national ID and Iqama numbers, Emirates ID numbers, Egyptian national numbers, Kuwaiti civil and Bahraini personal numbers, IBANs of the Arab states, phone numbers of the Arab League states, Saudi and UAE vehicle plates, e-mail addresses and URLs, in Western, Arabic-Indic and Persian digits, and check each candidate against its format: check digits, the IBAN registry, birth-date and governorate structure or the phone number plans. An optional model finds Arabic person names. A clitic-aware Arabic context enhancer counts words such as وجوالي and بالهوية as the context words جوال and هوية. What is found can be replaced with a typed placeholder, a mask or a generated value of the same format. The release includes a command line, a Python API that plugs into any Presidio AnalyzerEngine, a synthetic evaluation set and a free in-browser redactor.
| Licence | Apache-2.0 (code and in-browser redactor); CC BY 4.0 (evaluation set, results and documentation) |
|---|---|
| Version | v0.1.0 · Python package, command line, JavaScript port and evaluation set v0.1.0, tagged on GitHub. Not on PyPI yet. |
| Published | |
| Updated | |
| Who it is for | Teams that clean, share or publish Arabic and Arabic-English text and need to find and redact Gulf and Egyptian identity numbers, IBANs, phone numbers and names first. |
| Level | Intermediate |
Key numbers
Counted by script from the released files. Each key number is read from a results file in the Hugging Face evaluation set (the two metrics files and the Wikipedia check summary) and pinned to that file's SHA-256; the checksum file in the dataset lists the SHA-256 of every file.
Downloads and identifiers
| Where | What |
|---|---|
| bayanatlabs.com | Open the redactor |
| GitHub | Code on GitHub |
| Hugging Face | Evaluation set and results on Hugging Face |
| Hugging Face | In-browser redactor on Hugging Face Spaces |
Get started
Install from GitHub at the v0.1.0 tag; pip install bayanatlabs-arabic-pii will work once it is published on PyPI. Person names need the [ner] extra, which downloads the name model on first use.
pip install "git+https://github.com/Bayanat-Labs/arabic-pii-pack@v0.1.0"
# Command line
echo "جوالي 0501234567" | bl-arabic-pii redact
bl-arabic-pii redact --in records.jsonl --field text --operator fake --out redacted.jsonl
# In Python
>>> from bl_arabic_pii import redact
>>> redact("هويتي ١٠٠٠٠٠٠٠٠٨ وجوالي +966 50 123 4567").text
'هويتي [SA_NATIONAL_ID] وجوالي [PHONE_NUMBER]'
What is released
| Part | Licence | In this release |
|---|---|---|
| Python package, command line and JavaScript port | Apache-2.0 | Yes |
| Synthetic evaluation set, results and documentation | CC BY 4.0 | Yes |
| In-browser redactor on Hugging Face Spaces | Apache-2.0 | Yes |
| Optional name model (CAMeLBERT MSA NER by CAMeL Lab), downloaded at run time | Apache-2.0 | No |
Attribution: arabic-pii-pack by Bayanat Labs. https://github.com/Bayanat-Labs/arabic-pii-pack
Intended uses
- Find and redact identity numbers, IBANs, phone numbers, plates, e-mail addresses and URLs in Arabic and Arabic-English text before it is shared or used for training.
- Add Arabic and Gulf recognisers and a clitic-aware Arabic context enhancer to an existing Presidio AnalyzerEngine.
- Replace personal data with a generated value of the same format, so test data keeps its layout and passes the same checks.
- Test another detector against the synthetic evaluation set.
Out of scope
- Proving that a text holds no personal data: detection is a technical aid, and redacted output should be reviewed before publication.
- Checking whether a number was issued or belongs to anyone: the checks cover the format only, and nothing is looked up.
- Addresses, dates of birth, names in Latin letters and sensitive categories expressed in words: they are not detected in this version.
Rights at a glance
Training, display, redistribution and synthetic-voice use are separate permissions.
| Use | Status | Note |
|---|---|---|
| Training | Allowed | Code under Apache-2.0; evaluation set and results under CC BY 4.0 with attribution. The set is meant for testing; training on it makes its scores meaningless. |
| Display | Allowed | CC BY 4.0, with attribution. Generated examples; not real personal data; any match to a real person is coincidental. |
| Redistribution | Allowed | Code under Apache-2.0; evaluation set, results and documentation under CC BY 4.0 with attribution. |
| Synthetic voice | Not applicable | Text only; no audio. |
Limitations
- The evaluation set is synthetic and was written by the same team as the rules, so its scores show format coverage, not accuracy on real documents.
- Kuwaiti and Bahraini numbers and vehicle plates count only next to a context word; Egyptian national numbers are checked for structure, because no check-digit rule has been published.
- The in-browser redactor runs the rule-based recognisers only; person names need the Python package with the optional name model, which misses more names in dialect text.
- Install from GitHub for now; the package is not on PyPI yet.
Sources and licences
| Source | Licence | Redistributed here |
|---|---|---|
| Microsoft Presidio (dependency) | MIT | No |
| phonenumbers, Python port of libphonenumber (dependency) | Apache-2.0 | No |
| gcc-format-validators by Bayanat Labs (dependency) | Apache-2.0 (code); CC BY 4.0 (tables) | No |
| CAMeLBERT MSA NER by CAMeL Lab (optional model) | Apache-2.0 | No |
| Arabic Wikipedia (wikimedia/wikipedia), false-flag check | CC BY-SA 4.0 (Wikipedia contributors) | No |
The evaluation set was written by Bayanat Labs from templates, with every value produced by the package's own generators. Generated examples; not real personal data; any match to a real person is coincidental. The pack depends on Presidio, phonenumbers and gcc-format-validators without copying their code; the optional name model is fetched from the Hugging Face Hub at run time. The Wikipedia check keeps paragraph identifiers and counts, not text. Source details
How to cite
Cite as:
Bayanat Labs (2026). arabic-pii-pack: Arabic and Gulf personal-data recognisers and redaction for Microsoft Presidio, version 0.1.0. Bayanat Labs. https://github.com/Bayanat-Labs/arabic-pii-pack
No DOI. Cite the URL in the citation above and the date you read it.
@misc{bayanatlabs2026arabicpiipack,
author = {{Bayanat Labs}},
title = {arabic-pii-pack: Arabic and Gulf personal-data recognisers and redaction for Microsoft Presidio, version 0.1.0},
year = {2026},
month = oct,
howpublished = {\url{https://github.com/Bayanat-Labs/arabic-pii-pack}}
}
Changelog
| Date | Version | Change |
|---|---|---|
| v0.1.0 | Python package, command line and JavaScript port on GitHub; the synthetic evaluation set and results on Hugging Face; the in-browser redactor on Hugging Face Spaces. |
Corrections and removal requests
If something in this release should not be there, or is wrong, email hello@bayanatlabs.com. We handle removal requests within 30 days, and platform requests within 24 hours. How removal requests work
Related product: Bayanat Documents