{"id":50443592,"url":"https://github.com/unpatterned-labs/arche","last_synced_at":"2026-05-31T20:01:49.285Z","repository":{"id":361117003,"uuid":"1248305409","full_name":"unpatterned-labs/arche","owner":"unpatterned-labs","description":"African PII detection that cites the law it enforces.","archived":false,"fork":false,"pushed_at":"2026-05-29T07:59:32.000Z","size":2343,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T09:27:11.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unpatterned-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-24T13:20:28.000Z","updated_at":"2026-05-28T21:34:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/unpatterned-labs/arche","commit_stats":null,"previous_names":["unpatterned-labs/arche"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/unpatterned-labs/arche","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unpatterned-labs%2Farche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unpatterned-labs%2Farche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unpatterned-labs%2Farche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unpatterned-labs%2Farche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unpatterned-labs","download_url":"https://codeload.github.com/unpatterned-labs/arche/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unpatterned-labs%2Farche/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33746513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-31T20:01:43.876Z","updated_at":"2026-05-31T20:01:49.277Z","avatar_url":"https://github.com/unpatterned-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arche-core\n\n**African PII detection that cites the law it enforces.**\n\n\u003e [!WARNING]\n\u003e **Status:** pre-beta (development) -  `arche-core` is under active development. \n\n`arche-core` detects PII for African jurisdictions; government IDs, names, phone numbers, addresses, and grounds every detection in the data protection statute that governs it. NDPA, POPIA, Kenya DPA, Ghana DPA. Six closed policy actions. Composes with Presidio, GLiNER, and Splink.\n\n\u003e Presidio detects PII. GLiNER does multilingual NER. Splink links records. None of them know that a BVN is sensitive under NDPA §30, or that \"Adeyẹmí\" and \"Adeyemi\" are the same Yoruba name with and without tonal marks, or that \"behind Total filling station, Madina Junction\" is a parseable Ghanaian address. `arche-core` does that one job.\n\n```python\nfrom arche import Pipeline\n\npipeline = Pipeline(jurisdiction=\"NG\")        # auto-loads NDPA-2023\nresult = pipeline.process(\n    \"Fatima Abdullahi, NIN 12345678901, BVN 22100987654.\"\n)\n\nfor d in result.detections:\n    print(f\"{d.category:11} tier={d.sensitivity_tier.value:9} {d.regulatory_citation}\")\n# PII-2-BVN   tier=high      NDPA-2023 s.30, CBN BVN policy 2014\n# PII-2-NIN   tier=high      NDPA-2023 s.30, NIMC Act s.27\n# PII-1-NAME  tier=moderate  NDPA-2023 s.30            (×2 — given + family name)\n\nprint(result.redacted_text)\n# NAME_... NAME_..., NIN [NIN], BVN [BVN].\n```\n\nSame code works for `jurisdiction=\"ZA\"` (POPIA), `\"KE\"` (Kenya DPA), `\"GH\"` (Ghana DPA). Four launch jurisdictions, four DPA-grounded statute YAML files, one composable framework.\n\n## Install\n\n```bash\npip install arche-core          # ~310KB base — pure-Python detectors, statute policy\npip install arche-core[all]     # everything (GLiNER + Presidio + Splink + docling + LLM)\n```\n\n(Or `uv add arche-core` / `uv add arche-core[all]`.) Heavy capabilities are **opt-in extras**:\n\n| Extra | Adds |\n|---|---|\n| `arche-core[detect]` | GLiNER2-PII via ONNX runtime (multilingual neural soft-PII) |\n| `arche-core[presidio]` | Microsoft Presidio recognizer plugin |\n| `arche-core[resolve]` | Splink + DuckDB for large-scale entity resolution |\n| `arche-core[doc]` | docling for PDF / DOCX / PPTX / XLSX ingestion |\n\n## Coverage\n\nPer-launch-jurisdiction detection coverage. Every detector validates check-digits where the underlying spec supports it.\n\n| Jurisdiction | Statute | Detectors |\n|---|---|---|\n| Nigeria (NG) | NDPA-2023 | NIN (11 digits), BVN (11 digits, 22-prefix), TIN, RC, voter PVC, driver's licence |\n| Kenya (KE) | Kenya DPA 2019 | National ID, KRA PIN, NHIF |\n| South Africa (ZA) | POPIA | SA ID (13-digit Luhn + DOB/gender/citizenship decode), tax reference, passport |\n| Ghana (GH) | Ghana DPA 2012 | Ghana Card, SSNIT, TIN |\n| + 11 more African patterns | — | Egypt, Uganda, Rwanda, Tanzania, Cameroon, Senegal, ... |\n\nPlus libphonenumber-backed normalization for 30+ African phone networks, landmark-anchored address parsing for NG and ZA, and currency detection (Naira, Cedi, Rand, CFA).\n\n## The statute layer\n\nEvery detection emits a category, a sensitivity tier (`high` / `moderate` / `low`), and the specific statute section that classifies it. The Pipeline maps each to one of six closed actions — `mask`, `tokenize`, `drop`, `generalize`, `audit`, `retain` — per the configured jurisdiction's statute YAML.\n\n```python\nfor o in result.policy_outcomes:\n    print(o.category, o.action, o.statute_reference)\n# PII-2-BVN    mask       NDPA-2023 s.30, CBN BVN policy 2014\n# PII-2-NIN    mask       NDPA-2023 s.30, NIMC Act s.27\n# PII-1-NAME   tokenize   NDPA-2023 s.30\n```\n\nStatute YAMLs live at `arche/policy/_data/\u003cSTATUTE-ID\u003e.yaml` and are human-readable. Statute amendments are policy-file changes, not code changes.\n\n## Cultural naming intelligence\n\n`arche-core` ships a 114-group African name equivalence lexicon covering 454 name forms across 50+ ethnic traditions:\n\n- Mohammed = Muhammad = Mamadou = Muhammadu (Pan-Islamic)\n- Diallo = Jallow = Jalloh (Fulani cross-ethnic orthography)\n- Fatou = Fatoumata (West African diminutive)\n- Adeyemi = Adeyẹmi = Adeyẹmí (Yoruba tonal marks)\n- Pierre = Peter = Pedro (colonial-era cross-linguistic)\n- Irorere, Aibuedfe (Benin/Edo names with semantic meaning)\n\nGrowing via Wikidata + community curation. See [`datasets/`](../../datasets/) for the full dataset and contribution guide.\n\n## Composing with Presidio, GLiNER, and Splink\n\n`arche-core` is designed to compose with the incumbent tools, not replace them. The three integration patterns:\n\n```python\n# Presidio's English recognizers + arche's African recognizers\npip install arche-core[presidio]\n# arche.detect.presidio surfaces both as one recognizer set.\n\n# GLiNER's multilingual NER + arche's statute classification\npip install arche-core[detect]\n# Pipeline(jurisdiction=\"NG\", backend=\"gliner\") routes soft-PII through GLiNER.\n\n# Splink's record linkage + arche's jurisdiction-aware comparators\npip install arche-core[resolve]\n# Statute-tagged detections feed Splink as clean inputs.\n```\n\n## Audit log\n\n`arche.graph.audit` ships an SQLite-backed append-only log that records every detection, every policy decision, and every action taken — queryable by compliance officers and regulators. **PII values are never stored**; only categories, span offsets, and document hashes. Markdown compliance report generator for regulator-ready exports.\n\n## Power-user features\n\nThese ship in the package but are not in the headline pitch — they support specific identity workflows on top of the detection layer:\n\n- **`arche.sign`** — Ed25519 + JWS + did:key signing for `Pipeline.Result` envelopes. SD-JWT-VC issue / verify via `arche.credentials.sd_jwt`. See [`examples/02_sign_share_extract.py`](../../examples/02_sign_share_extract.py) and [`examples/04_sd_jwt_credential.py`](../../examples/04_sd_jwt_credential.py).\n- **`arche.workflow.dsar`** — citizen-side DSAR draft generation with per-jurisdiction statute citations. See [`examples/03_dsar_workflow.py`](../../examples/03_dsar_workflow.py).\n- **`arche.resolve`** — lightweight Fellegi-Sunter matcher with jurisdiction-specific priors. `from arche import match` for two-record comparison; `from arche import link` for cross-source resolution.\n- **`arche.workflow._review`** — MPI review queue for human-in-the-loop match decisions. Not on the public surface; import from the canonical path.\n- **`arche.resolve_places` / `arche.list_places`** — jurisdictional place lookup with verifiable audit receipts.\n\nThese are real tools we depend on internally. They are not the lead pitch.\n\n\n## License\n\nApache 2.0. By [Unpatterned Labs](https://unpatterned.org).\n\n\u003e `arche-core` is under active development. APIs may change between alpha  releases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funpatterned-labs%2Farche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funpatterned-labs%2Farche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funpatterned-labs%2Farche/lists"}