API Reference¶
The arche-core v0.2 public surface is intentionally slim. Everything below is importable from arche.
For the deeper substrate APIs, import from the substrate package directly. For exhaustive auto-generated reference, see the source on GitHub - the v0.2.0a3 release introduces mkdocstrings-rendered API pages.
v0.2 surface¶
| Symbol | Purpose | Page |
|---|---|---|
Pipeline |
The framework primitive - detect + policy + audit in one call | resolve.md |
Result |
Typed return from Pipeline.process(...) |
resolve.md |
Detection |
A single detected PII span with category, span, confidence | resolve.md |
Plus __version__.
Substrate APIs¶
Detect - arche.detect¶
from arche.detect.ng.ids import detect_nigerian_ids
from arche.detect.ke.ids import detect_kenyan_ids
from arche.detect.za.ids import detect_south_african_ids
from arche.detect.gh.ids import detect_ghanaian_ids
from arche.detect._africa.ids import detect_african_ids
from arche.detect._africa.phones import normalize_e164, validate_phone
Per-country ID detectors return list[Detection]. Phone helpers wrap phonenumbers (libphonenumber port) for E.164 normalization.
Policy - arche.policy¶
Statute YAMLs live at arche/policy/statutes/. Four launch jurisdictions: NDPA-2023 (NG), POPIA (ZA), KENYA-DPA, GHANA-DPA.
Address - arche.addr¶
NG + ZA address parser MVP. Other jurisdictions are not yet included.
Sign + Credentials - arche.sign, arche.credentials¶
from arche.sign import (
generate_keypair,
SignWorkflow,
VerifyExtractWorkflow,
ArcheSignedDocument,
)
from arche.credentials.sd_jwt import (
issue_sd_jwt,
verify_sd_jwt,
present,
envelope_to_sd_jwt,
)
Ed25519 + did:key + JWS. SD-JWT-VC for wallet ecosystem interop (EUDI Wallet ARF / MOSIP Inji format).
Audit - arche.graph.audit¶
SQLite-backed append-only log. PII values never stored - only category labels, spans, document hashes. Signed export bundles for regulator handoff. See PRD Section 8.2.
Workflows - arche.workflow¶
Pipeline composes detect, policy, and audit. DSARWorkflow is the citizen-side Data Subject Access Request drafter for NDPA / POPIA / Kenya DPA / Ghana DPA.
Document ingest - arche.doc (optional)¶
docling-backed PDF/DOCX/PPTX/XLSX/HTML parser. Pipeline.process_file(path) delegates to this substrate.
Entity resolution - arche.resolve¶
Fuzzy Fellegi-Sunter with African-name equivalence by default. With arche-core[resolve] installed, arche can use a Splink+DuckDB backend for larger workloads. See the entity resolution tutorial.
See the Quick Start and HOW-TO Section 10 for the full migration walk-through.