Brazil ๐ง๐ท ANAC Registry โ
| Name | br-anac-registry |
| Country | Brazil |
| Registration prefix | PP- / PR- / PT- / PS- / PU- |
| Data source | https://sistemas.anac.gov.br/dadosabertos/Aeronaves/RAB/dados_aeronaves.json |
| Format | JSON API (fixed URL, full register dump) |
| Run frequency | Weekly (Wednesday, 08:10 UTC) |
| Depends on Mictronics for ICAO hex | Yes โ this runner does not publish ICAO hex addresses; registrations (formatted from MARCA) are resolved via RediSearch against Mictronics records (idx:aircraft:mictronics). Must run after the mictronics runner. |
How it works โ
The full Registro Aeronรกutico Brasileiro (RAB) JSON dump is downloaded from a fixed URL (utf-8-sig decoded). Records are filtered to active registrations only โ rows with a cancellation date (DTCANC) set, or whose CDINTERDICAO starts with R or M, are excluded. The MARCA field (e.g. PPAJH) is reformatted into a hyphenated registration (PP-AJH). Registrations are resolved to icao_hex in batches of 100 via RediSearch against the Mictronics index, then a type sanity check compares tokens from DSMODELO against the existing Mictronics record, rejecting the match only when both sides have tokens and none overlap. CDCLS is a compact 3-character code ({landing}{engine count}{propulsion}, or the literal RPA for drones) decoded into aircraft.type, aircraft.category, and the powerplant count/type. The embedded PROPRIETARIOSJSON owner list uses a non-standard /"" escape sequence for embedded quotes that is un-escaped before json.loads; only the first owner's name is kept, and placeholder values like Indisponรญvel are treated as absent. Unlike the other runners in this batch, writes to Redis here are per-record (not pipelined). Every written record explicitly sets military: false โ this register is exclusively civil, and the explicit value ensures a stale military: true flag (from Mictronics or a prior record on a reused hex) is corrected on re-registration.
Whenever a record has an aircraft.type_designator, aircraft:type:{type_designator} is looked up in Redis (populated by the mictronics runner) and, if found, its manufacturer_model and description_code (ICAO Doc 8643 description code, e.g. L2J) are set directly on this record โ unconditionally, regardless of whether Mictronics also has values for the same hex. This runner's own type_designator is sourced directly from ANAC and is authoritative; merge_aircraft.lua's "registry wins over mictronics" precedence rule guarantees these values take priority at read time either way. The lookup is not a hard dependency โ a missing reference table entry, or the table not existing yet, leaves the record exactly as it would have been without this step.
Columns โ
| Source column | Imported | Notes |
|---|---|---|
MARCA | โ | Reformatted to hyphenated registration (e.g. PPAJH โ PP-AJH); used as the Mictronics lookup key |
DTCANC | โ | Used only as a filter (non-empty = inactive, row skipped); not stored |
CDINTERDICAO | โ | Used only as a filter (R/M prefix = inactive, row skipped); not stored |
CDCLS | โ | Decoded into aircraft.type, aircraft.category, aircraft.powerplant.count, aircraft.powerplant.type |
NMFABRICANTE | โ | โ aircraft.manufacturer |
DSMODELO | โ | โ aircraft.model; also used for the type sanity check against Mictronics |
CDTIPOICAO | โ | โ aircraft.type_designator; also used to look up aircraft:type:{type_designator} in Redis, setting aircraft.manufacturer_model and aircraft.description_code when found |
NRSERIE | โ | โ aircraft.serial_number |
NRASSENTOS | โ | โ aircraft.seats |
NRANOFABRICACAO | โ | โ aircraft.manufactured_date (4-digit year โ YYYY-01-01T00:00:00Z) |
PROPRIETARIOSJSON | โ | โ registrant.names[0]; embedded JSON with a non-standard quote escape; placeholder names (e.g. Indisponรญvel) are filtered |
CDPROPOSITOCAVE | โ | Present in source; not read by this runner |
CDTIPO | โ | Present in source; not read by this runner |
CFOPERACIONAL | โ | Present in source; not read by this runner |
DSCATEGORIAHOMOLOGACAO | โ | Present in source; not read by this runner |
DSGRAVAME | โ | Present in source; not read by this runner |
DSMOTIVOCANC | โ | Present in source; not read by this runner |
DTVALIDADECA | โ | Present in source; not read by this runner |
DTVALIDADECVA | โ | Present in source; not read by this runner |
DT_MATRICULA | โ | Present in source; not read by this runner |
NRCERTMATRICULA | โ | Present in source; not read by this runner |
NRPASSAGEIROSMAX | โ | Present in source; not read by this runner |
NRPMD | โ | Present in source; not read by this runner |
NRTRIPULACAOMIN | โ | Present in source; not read by this runner |
OPERADORESJSON | โ | Present in source; not read by this runner |
QTMOTOR | โ | Present in source; not read by this runner |
TPCA | โ | Present in source; not read by this runner |
TPMOTOR | โ | Present in source; not read by this runner |
TPOPERADOR | โ | Present in source; not read by this runner |
TPPOUSO | โ | Present in source; not read by this runner |
See specs/data-dictionary.yaml (br-anac-registry entry) for full column semantics and cross-source schema notes.
Example Output โ
Read back the merged record for a given ICAO hex (combines this runner's data with Mictronics and any other sources that have written to the same key):
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 E48DBF | python3 -m json.tool --sort-keys --no-ensure-ascii{
"aircraft": {
"category": "Land",
"description_code": "L1P",
"manufactured_date": "2006-01-01T00:00:00Z",
"manufacturer": "BEECH AIRCRAFT",
"manufacturer_model": "BEECH 36 Bonanza",
"model": "G36",
"powerplant": {
"count": 1,
"type": "Piston"
},
"seats": 6,
"serial_number": "E3722",
"type": "Airplane",
"type_designator": "BE36"
},
"data_sources": [
"mictronics",
"br-anac-registry"
],
"icao_hex": "E48DBF",
"military": false,
"registrant": {
"names": [
"MARCELO BERNARDINO GUARNIERI"
]
},
"registration": "PP-OCC"
}docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 E47F21 | python3 -m json.tool --sort-keys --no-ensure-ascii{
"aircraft": {
"category": "Land",
"description_code": "L2J",
"manufactured_date": "2005-01-01T00:00:00Z",
"manufacturer": "BOEING COMPANY",
"manufacturer_model": "BOEING 767-300",
"model": "767-316F",
"powerplant": {
"count": 2,
"type": "Turbo-jet"
},
"seats": 6,
"serial_number": "34245",
"type": "Airplane",
"type_designator": "B763"
},
"data_sources": [
"mictronics",
"br-anac-registry"
],
"icao_hex": "E47F21",
"military": false,
"registrant": {
"names": [
"LAN CARGO S.A."
]
},
"registration": "PR-ABD"
}Configuration โ
See Data Runners for the full list of environment variables every runner reads. This runner writes aircraft:registry:{icao_hex} with a fixed 14-day TTL (ENRICHMENT_TTL_SECONDS in shared/timing.py).
MQTT โ
Published once, at the end of a run, to SkyFollower/runner/br-anac-registry/statistic/{name} (all retained):
| Topic suffix | Value | Format |
|---|---|---|
records_imported | e.g. 271 | Integer as string |
last_run_at | e.g. 2026-07-07T14:32:01.123456+00:00 | ISO 8601 UTC |
last_run_status | Success or Failure | String |
Home Assistant autodiscovery configs are also published (retained) to homeassistant/sensor/SkyFollower_runner_br_anac_registry_{name}/config for each of the three stats above.