Skip to content

v1.0.17

Choose a tag to compare

@github-actions github-actions released this 01 May 15:07
c844705

v1.0.17 — service-specific aviation profiles

Closes the last outstanding bullet of upstream issue savoirfairelinux/num2words#478"different variations depending on ICAO, FAA, US Navy, US Army".

What's new

Five named aviation profiles, plus a programmatic profile= constructor argument:

from num2words2 import num2words

num2words(5739, lang='en_Aero_FAA')        # 'fife seven tree niner'
num2words(5739, lang='en_Aero_USN')        # 'fife seven tree niner'
num2words(5739, lang='en_Aero_US_Navy')    # 'fife seven tree niner'
num2words(5739, lang='en_Aero_US_Army')    # 'fife seven tree niner'
num2words(5739, lang='en_Aero_NATO')       # 'fife seven tree niner'

# Or programmatically:
from num2words2.lang_EN_AERO import Num2Word_EN_AERO
Num2Word_EN_AERO(profile='FAA').to_cardinal(5739)

Modern services have all converged on the ICAO digit table (FAA AIM 4-2-9 cites ICAO; STANAG 1059 defers to ICAO; US military adopted ICAO post-1956), so today all five profiles produce identical output. They exist as separate named entry points so:

  1. Calls can document which standard they target in code, even when the bytes match ICAO.
  2. Future divergent variants — historical WW2-era US Army/Navy respellings, ITU/IMO maritime, tactical service deviations — can be added by populating their profile tuple without breaking back-compat.

Cumulative state of the aviation feature (v1.0.14 → v1.0.17)

Release Scope
v1.0.14 initial en_AERO, common-subset digits
v1.0.15 strict ICAO digit table (wun/too/ait) + canonical en_Aero_ICAO key + BCP 47 alias en-x-aero-icao
v1.0.16 per-context phraseology methods: to_altitude, to_flight_level, to_heading, to_squawk, to_runway, to_frequency
v1.0.17 service-specific profiles + programmatic profile= arg

The full en_Aero_* family is feature-complete for the ICAO/aviation use case as currently defined.

Bug fix bundled

An earlier draft of #117 placed the new subclasses inside the parent class scope by accident, which silently ended Num2Word_EN_AERO before its methods were defined and broke to_cardinal / to_altitude / etc. (smoke test caught it: ICAO suddenly produced plain-English output instead of digit-by-digit). Subclasses now live at module level after the parent class body. ✓

What's Changed

  • feat(en_aero): service-specific profiles (FAA, USN, US_Army, NATO) (#117)

Full Changelog: v1.0.16...v1.0.17

Installation

pip install num2words2==1.0.17
# or AUR:
yay -S python-num2words2

Documentation

For the full feature reference (all conversion modes, per-call options, language list, aviation phraseology), see REFERENCE.md.