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.
Metadata
Release files for arabic-fix 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arabic_fix-0.4.1.tar.gz | 39.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arabic_fix-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.6 kB
Release files / arabic_fix-0.4.1.tar.gz
| Download URL | arabic_fix-0.4.1.tar.gz |
|---|---|
| Size | 39.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e49edd89e57165edfe3b64d3ac484c1c66b1259d703297c970740866f29a392
|
|
BLAKE2b-256 checksum How to use checksums |
889a977e6e018bca28e1109d785ea070a8d837c15a1b31edc6fc7297e4b627d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 9, 2026.
Transparency logRelease files / arabic_fix-0.4.1-py3-none-any.whl
| Download URL | arabic_fix-0.4.1-py3-none-any.whl |
|---|---|
| Size | 45.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
828cce147922efbe6c4000568a508ddc80d0be5f87f510cd0799aebc5086b01c
|
|
BLAKE2b-256 checksum How to use checksums |
f5955d2eae21296f4a17de12604711865fa4ca97fe9f1d922918a24533b04b8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 9, 2026.
Transparency log