Normalizing fragmented OBD-II and OEM fault codes into one search engine.
Automotive diagnostic trouble codes are often trapped in inconsistent manufacturer PDFs, disparate CSV dumps, and scanner firmware lacking severity context, standardized system taxonomy, or bilingual coverage.
The Automotive DTC Codes Platform consolidates 14,204 fault codes across OBD-II, J1939, and UDS into a strict canonical JSON schema and normalized PostgreSQL database with pg_trgm trigram and full-text hybrid search.
Alongside the containerized FastAPI + Redis + PostgreSQL service and Python CLI, the four-stage pipeline exports portable SQLite files for offline diagnostic tools and publishes a serverless static JSON API via GitHub Pages.
Docker stack, CLI lookup, and static JSON API.
Provision PostgreSQL, Redis, and the FastAPI service with ./setup.sh, run diagnostic lookups via src/service/cli.py, or query 14,204 pre-exported codes on GitHub Pages.
# Provision PostgreSQL, Redis & ingest pipeline
./setup.sh
# CLI lookup & bilingual search
python src/service/cli.py lookup P0300
python src/service/cli.py search "misfire" --locale pt-BR
# FastAPI REST search with X-API-Key
curl -H "X-API-Key: dev_key_2026" \
"http://localhost:8000/search?q=P010"{
"code": "P0300",
"system": "powertrain",
"category_letter": "P",
"generic": true,
"description": "Random/Multiple Cylinder Misfire Detected",
"severity": "critical"
}From legacy PDFs to hybrid diagnostic search.
A four-stage ETL pipeline feeding both a Redis-cached FastAPI backend and portable offline/static artifacts.
4-Stage ETL & OCR Pipeline
src/pipeline/ handles Extraction from JSON, CSV, and PDF manuals (with OCR fallback for scanned legacy files), Normalization against schema/dtc.schema.json, PostgreSQL Ingestion, and SQLite/static export.
PostgreSQL pg_trgm Hybrid Search
schema/schema.sql models dtc_codes, dtc_definitions, manufacturers, systems, and severities, pairing PostgreSQL full-text search with trigram similarity ranking for typo-tolerant suggestions.
FastAPI Service, Auth & Analytics
src/service/api.py verifies X-API-Key credentials, caches responses in Redis, logs query metrics to search_analytics, and exposes /dtc/{code}, /search, /trends, /stats, Swagger UI, and ReDoc.
Static JSON API & Portable SQLite
export_static_api.py generates 14,204 per-code JSON files, prefix bundles, and index.json for GitHub Pages, while export_sqlite.py outputs lightweight SQLite databases for edge and mobile scanners.
API Surface, Pipeline Modules & Stack
- GET /dtc/{code}?locale=en-US|pt-BR
- GET /search?q=...&limit=20&offset=0
- GET /trends, /stats & /health
- CLI: lookup & search commands
- Static: /api/dtc/{CODE}.json & index.json
- schema/dtc.schema.json canonical model
- schema/schema.sql with pg_trgm extension
- extract_aptta.py, extract_dicas.py & mega_merge.py
- deduplicate.py & normalize.py
- export_sqlite.py & export_static_api.py
- Python 3.10+ & FastAPI REST backend
- PostgreSQL + Redis container stack
- Swagger UI (/docs) & ReDoc (/redoc)
- GitHub Pages static API & search portal
- MIT License