Fix Arabic text rendering across code, AI agents, and designs.
Project description
arabic-fix
Fix Arabic text rendering across code, AI agents, and designs.
One library, one CLI, one system prompt. Letter-shaping, BiDi reordering, Unicode normalization, and a 3-section prompt template for any LLM. Arabic flows through terminals, AI agents, log files, and PDFs the way it should.
pip install arabic-fix
from arabic_fix import fix
print(fix("User 42 من الرياض at 09:30"))
# → a properly shaped, correctly ordered, NFC-normalized string
# CLI
cat arabic.txt | arabic-fix
arabic-fix --check file.txt # CI mode: exit non-zero if changes needed
# AI agent: paste one of the 3 sections from agents/system_prompt.md
# A · Read Arabic — for agents that parse / summarize / classify
# B · Write Arabic — for agents that emit to terminal / log / email
# C · Design Arabic — for HTML / CSS / Tailwind / design tokens
Why
- Letter shaping —
ا ب ت(isolated forms) becomeاتصال(connected) via Unicode Presentation Forms-B. - BiDi order —
User 42 من الرياضends up with42on the visual left and Arabic letters in their connected form, per UAX #9. - Tashkeel preserved — diacritics survive;
مَرْحَبًاround-trips intact. - Logical CSS only —
margin-inline-start, nevermargin-left. - Real Arabic fonts — Tajawal, IBM Plex Sans Arabic, Noto Naskh Arabic in priority order; never Inter or Roboto.
What's in the box
| Path | What it is |
|---|---|
arabic_fix/ |
Python library: fix(), shape(), reorder(), normalize() |
agents/system_prompt.md |
3 splice-in-able sections for any LLM |
agents/eval_cases.md |
15 cases to verify the system prompt works |
designs/tokens.json |
73 design tokens (W3C DTCG), CSS / Tailwind / Figma exports |
examples/sample-arabic-page.html |
5 Arabic surfaces using the tokens |
docs/roadmap.md |
v0.2 → v0.6 milestones |
Verify
pytest -q # 169 tests
mypy arabic_fix # strict, clean
python designs/validate_tokens.py # 73 token schema check
License
MIT — see LICENSE. The brand arabic-fix is locked until v1.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arabic_fix-0.4.1.tar.gz.
File metadata
- Download URL: arabic_fix-0.4.1.tar.gz
- Upload date:
- Size: 39.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e49edd89e57165edfe3b64d3ac484c1c66b1259d703297c970740866f29a392
|
|
| MD5 |
ba9f96949d58f1dd0c37f4dd8d4308c2
|
|
| BLAKE2b-256 |
889a977e6e018bca28e1109d785ea070a8d837c15a1b31edc6fc7297e4b627d0
|
Provenance
The following attestation bundles were made for arabic_fix-0.4.1.tar.gz:
Publisher:
publish.yml on MahmoudElHassan/arabic-fix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arabic_fix-0.4.1.tar.gz -
Subject digest:
4e49edd89e57165edfe3b64d3ac484c1c66b1259d703297c970740866f29a392 - Sigstore transparency entry: 2131025290
- Sigstore integration time:
-
Permalink:
MahmoudElHassan/arabic-fix@0fc4843fc2d7aa780de8ff0f17ecd287428176c1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MahmoudElHassan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0fc4843fc2d7aa780de8ff0f17ecd287428176c1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file arabic_fix-0.4.1-py3-none-any.whl.
File metadata
- Download URL: arabic_fix-0.4.1-py3-none-any.whl
- Upload date:
- Size: 45.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
828cce147922efbe6c4000568a508ddc80d0be5f87f510cd0799aebc5086b01c
|
|
| MD5 |
f5af28b5022076f65e628af7a00b00b8
|
|
| BLAKE2b-256 |
f5955d2eae21296f4a17de12604711865fa4ca97fe9f1d922918a24533b04b8b
|
Provenance
The following attestation bundles were made for arabic_fix-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on MahmoudElHassan/arabic-fix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arabic_fix-0.4.1-py3-none-any.whl -
Subject digest:
828cce147922efbe6c4000568a508ddc80d0be5f87f510cd0799aebc5086b01c - Sigstore transparency entry: 2131025335
- Sigstore integration time:
-
Permalink:
MahmoudElHassan/arabic-fix@0fc4843fc2d7aa780de8ff0f17ecd287428176c1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MahmoudElHassan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0fc4843fc2d7aa780de8ff0f17ecd287428176c1 -
Trigger Event:
workflow_dispatch
-
Statement type: