Searchable RTL-Arabic dashboard for Egypt's full customs tariff schedule — 8,800+ HS codes with duty rates, taxes & trade-agreement preferences. Async scraper → SQLite → static site.
# Egyptian Customs Tariff
A searchable, RTL-Arabic dashboard for Egypt's full import customs tariff schedule — every HS code, duty rate, tax, and free-trade-agreement preference, scraped from the Egyptian Customs Authority and served as a fast static site.
**🔎 Live site:
samehkamaleldin.github.io
> ⚠️ Unofficial. Data is scraped from customs.gov.eg for reference and research. Always verify against the official source before relying on it for a shipment or declaration.
---
## What's inside
The dataset covers the complete import schedule:
| Metric | Count |
| --- | --- |
| Tariff (HS) codes | **8,802** |
| Chapters | **95** |
| Tax & agreement entries | **14,421** |
| Regulatory instructions | **16,867** |
For each tariff code you get the Arabic description, import duty and VAT rates, all applicable taxes and levies (health insurance, chamber fees, table tax…), preferential rates under trade agreements (EU–Egypt, UK, Turkey, MERCOSUR, EFTA, AfCFTA, GSTP, WTO/GATT), and the linked regulatory instructions.
## How it works
The project is a three-stage pipeline plus two ways to serve the data.
```
customs.gov.eg ──▶ main.py ──▶ etl.py ──▶ customs.db ──┬──▶ web/ (static site) ← deployed
(scrape) (async) (normalize + (SQLite) └──▶ api.py (FastAPI) ← optional
translate)
```
1. **Scrape** — `main.py` is an async scraper (`aiohttp`, concurrency-limited with retry/backoff/throttle) that discovers every HS code across all 97 chapters, then fetches full detail for each. Outputs raw JSON to `data/`.
2. **Transform** — `etl.py` normalizes the raw JSON into a relational SQLite database (`data/customs.db`) with FTS5 full-text search, maps Arabic tax/agreement labels to English, and exports a compact `web/public/data.json` for the frontend.
3. **Serve** — the React frontend (`web/`) loads `data.json` and does all search, filtering, and drill-down client-side, so the deployed site needs **no backend**. A FastAPI service (`api.py`) i …