Skip to content

Bulgaria ๐Ÿ‡ง๐Ÿ‡ฌ CAA Registry โ€‹

Namebg-caa-registry
CountryBulgaria
Registration prefixLZ-
Data sourcehttps://www.caa.bg/bg/category/300/17238
FormatXlsx (date-encoded filename, discovered via index page)
Run frequencyWeekly (Wednesday, 00:10 UTC)
Depends on Mictronics for ICAO hexYes โ€” this runner does not publish ICAO hex addresses; LZ- registrations are resolved via RediSearch against Mictronics records (idx:aircraft:mictronics). Must run after the mictronics runner.

How it works โ€‹

The Bulgaria CAA index page is scraped for a link matching Aircraft_Register_\d+.xlsx, then that xlsx is downloaded and parsed with openpyxl in read-only mode. The first two rows (an info line and the header row) are skipped; data starts at row 2. Columns are addressed by fixed 0-based position rather than by header name, and only rows whose registration column starts with LZ- are kept. Registrations are resolved to icao_hex in batches of 100 via RediSearch against the Mictronics index โ€” unlike the other runners in this batch, bg-caa-registry does not run a model/type sanity check against the existing Mictronics record before writing. 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.

Columns โ€‹

Source columnImportedNotes
ะ ะตะณ. โ„– (col 0)โŒParsed row but column not read; registration comes from col 4 instead
ะ”ะฐั‚ะฐ (col 1, Excel serial date)โŒNot read
ะœะพะดะตะป (col 2)โœ…โ†’ aircraft.model
ะกะตั€ะธะตะฝ โ„– (col 3)โœ…โ†’ aircraft.serial_number
ะ ะตะณ. ะทะฝะฐะบ (col 4)โœ…LZ--prefix; used as the Mictronics lookup key
ะšะฐั‚ะตะณะพั€ะธั ะ’ะก (col 5)โœ…โ†’ aircraft.type, decoded via a category map (e.g. sailplane โ†’ Glider); unmapped values are dropped, not passed through
ะžัะฝะพะฒะฐะฝะธะต (col 6)โŒNot read

See specs/data-dictionary.yaml (bg-caa-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):

bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 451C2B | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufacturer": "CIRRUS",
        "manufacturer_model": "CIRRUS SR-22",
        "model": "Cirrus SR 22",
        "serial_number": "00488",
        "type": "Airplane",
        "type_designator": "SR22"
    },
    "data_sources": [
        "mictronics",
        "bg-caa-registry"
    ],
    "icao_hex": "451C2B",
    "military": false,
    "registration": "LZ-ALA"
}
bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 451E92 | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufacturer": "AIRBUS",
        "manufacturer_model": "AIRBUS A-319",
        "model": "Airbus A319-112",
        "serial_number": "03188",
        "type": "Airplane",
        "type_designator": "A319"
    },
    "data_sources": [
        "mictronics",
        "bg-caa-registry"
    ],
    "icao_hex": "451E92",
    "military": false,
    "registration": "LZ-AOB"
}

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/bg-caa-registry/statistic/{name} (all retained):

Topic suffixValueFormat
records_importede.g. 271Integer as string
last_run_ate.g. 2026-07-07T14:32:01.123456+00:00ISO 8601 UTC
last_run_statusSuccess or FailureString

Home Assistant autodiscovery configs are also published (retained) to homeassistant/sensor/SkyFollower_runner_bg_caa_registry_{name}/config for each of the three stats above.