How dccaceres/ruc-dnit works
DNIT RUC Zip Downloader combines a CLI-driven data-ingestion workflow with a REST API for RUC lookup. The documented ingestion stages are page link discovery, ZIP download and extraction, TXT unification, CSV validation, and SQLite creation; API requests then query that database and format results. The README documents the complete ingestion capabilities, while the excerpts show the CLI-to-downloader call and API query implementation. Some ingestion-stage connections are therefore documented rather than independently visible in the sampled code.
Main entry points: api.py REST API · downloader.py CSV validation · main.py Downloader CLI
Components 16
Data ingestion
- Downloader CLI
src/main.py - ZIP discovery
src/downloader.py - ZIP download
src/downloader.py - ZIP extraction
src/downloader.py
Data processing
- TXT unification
src/downloader.py - CSV validation
src/downloader.py - SQLite creation
src/downloader.py
RUC API
- REST API
src/api.py - Exact RUC lookup
src/api.py - Name search
src/api.py - Response formatting
src/api.py - Health check
src/api.py
RUC storage
- Validated CSV
src/downloader.py - RUC database
Other components
- Operator
- DNIT website
Connections 18
- Operator → Downloader CLI: runs
README.md - Downloader CLI → ZIP discovery: processes URL
src/main.py - DNIT website → ZIP discovery: provides page
README.md - ZIP discovery → ZIP download: finds links
src/downloader.py - ZIP download → ZIP extraction: downloads archives
src/downloader.py - ZIP extraction → TXT unification: supplies TXT files
src/downloader.py - TXT unification → CSV validation: writes CSV
src/downloader.py - CSV validation → Validated CSV: cleans data
README.md - CSV validation → SQLite creation: validates input
src/downloader.py - SQLite creation → RUC database: writes records
src/downloader.py - Operator → REST API: queries
README.md - REST API → Exact RUC lookup: routes exact lookup
src/api.py - REST API → Name search: routes search
src/api.py - Exact RUC lookup → RUC database: queries RUC
src/api.py - Name search → RUC database: queries names
src/api.py - REST API → Health check: serves health
src/api.py - Exact RUC lookup → Response formatting: formats match
src/api.py - Name search → Response formatting: formats results
src/api.py