Skip to content

🇬🇬 gg-2reg

CountryGuernsey (Bailiwick of Guernsey)
Registration prefix2-
Data sourcehttps://www.2-reg.com/legislation/register/
FormatPDF (date-encoded filename, discovered via index page)
Run frequencyWeekly (Tuesday, 18:10 UTC)
Depends on Mictronics for ICAO hexYes — this runner does not publish ICAO hex addresses; registrations are resolved via RediSearch against Mictronics records (idx:aircraft:mictronics). Must run after the mictronics runner.

How it works

The index page is scraped to discover the current register PDF (matches /wp-content/uploads/*/Register_*.pdf). Pages whose first line matches a known special-section heading (New Registrations, Deregistrations, Ownership Changes, Registration Changes, Reserved Marks) are skipped. Remaining pages are parsed by grouping extracted words into columns by x-position, since pdfplumber's table detection does not reliably find the column boundaries in this PDF. MSN (serial number) is whitespace-collapsed like manufacturer, model, and owner already are, since a word-position-grouped cell can end up with an embedded newline rather than a space. 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

The main register table (all pages before the special sections) has six columns. The special sections at the end of the PDF (New Registrations, Deregistrations, Ownership Changes, Registration Changes, Reserved Marks) are skipped entirely by this runner, but several of them present additional columns not found in the main table; those are listed below too, since they genuinely exist in the source.

Source columnImportedNotes
Registration2-prefix; used as the Mictronics lookup key
Aircraft Manufactureraircraft.manufacturer
Typeaircraft.model
MSNaircraft.serial_number; embedded newlines collapsed to a single space
Registered Ownerregistrant.names[0]; privacy placeholders (e.g. (private)) are filtered, not stored
Date of RegistrationParsed but not stored
Deregistered onOnly present in the "Deregistrations" special section; entire page is skipped by this runner
Exported toOnly present in the "Deregistrations" special section; entire page is skipped by this runner
Previous Owner/Charterer by DemiseOnly present in the "Registration Ownership Changes" special section; entire page is skipped by this runner
Ownership ChangedOnly present in the "Registration Ownership Changes" special section; entire page is skipped by this runner
Previous MarksOnly present in the "Registration Changes" special section; entire page is skipped by this runner
Effective dateOnly present in the "Registration Changes" special section; entire page is skipped by this runner
Reserved/Unavailable Registration Marks listThe "All Current Reserved or Unavailable Registration Marks" page is skipped entirely; it is a plain list of marks with no owner/aircraft data

See specs/data-dictionary.yaml (gg-2reg 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 43EC60 | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "manufacturer": "The New Piper Aircraft, Inc",
        "manufacturer_model": "PIPER PA-28-201T/235/236",
        "model": "PA-28-235",
        "serial_number": "28-7210009",
        "type_designator": "P28B",
        "wake_turbulence_category": "Light"
    },
    "icao_hex": "43EC60",
    "military": false,
    "registration": "2-GOLD",
    "source": "gg-2reg"
}

Note: registrant is entirely absent here — this aircraft's owner is recorded as (private) in the source PDF, which is filtered at write time rather than stored.

Configuration

Reads settings.json (mounted at /app/settings.json):

ParameterRequiredDefaultNotes
redis.hostRedis connection host
redis.port6379
mqtt.hostOmit the whole mqtt block to skip completion-stats publishing entirely
mqtt.port1883
mqtt.usernameOptional MQTT auth; omit for an anonymous broker
mqtt.password
redis_ttl_days14TTL applied to each aircraft:registry:{icao_hex} key written by this runner

MQTT

Published once, at the end of a run, to SkyFollower/runner/gg-2reg/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_gg_2reg_{name}/config for each of the three stats above.