Skip to main content

Script converting US issued ICAO addresses to N-Numbers (Tail Numbers) and reciprocally.

Project description

ICAO – N-Number Converter

Script converting ICAO addresses to N-Numbers (Tail Numbers) and reciprocally. Only works for United States aircraft registrations.

Using the converter

Requirements

  • Python 3.x
  • Nothing else =)

Install

Using pip install

pip install icao_nnumber_converter_us

Usage of the n_to_icao and icao_to_n functions. Note that both functions return None on invalid input.

python3
>>> from icao_nnumber_converter_us import n_to_icao, icao_to_n
>>> n_to_icao("N12345")
'a061d9'
>>> icao_to_n("abcdef")
'N86QU'

Or simply clone the repo, and start converting.

git clone https://github.com/guillaumemichel/icao-nnumber_converter.git
cd icao-nnumber_converter

Convert N-Number to ICAO address

> python3 convert.py N12345
a061d9

Convert ICAO address to N-Number

> python3 convert.py abcdef
N86QU

Format & Mapping

ICAO addresses are hexadecimal values of length 6. US registered ICAO addresses start with 'a'. N-Numbers, or Tail Numbers, are alphanumerical strings at most 6 characters long. US registered Tail Numbers start with 'N' (that's why they are called N-Number, yes!). Their format is as defined below.

There is a direct sequential mapping from US ICAO addresses to N-Number, from a00001 for N1 to adf7c7 for N99999. The mapping is somewhat intuitive, but not convenient to implement.

The mapping goes like this:

ICAO address N-Number
a00001 N1
a00002 N1A
a00003 N1AA
a00004 N1AB
a00005 N1AC
... ...
a0001a N1AZ
a0001b N1B
a0001c N1BA
a0001d N1BB
... ...
a00259 N1ZZ
a0025a N10
a0025b N10A
a0025c N10AA
a0025d N10AB
... ...
a004b2 N10ZZ
a004b3 N100
a004b4 N100A
a004b5 N100AA
a004b6 N100AB
... ...
a0070b N100ZZ
a0070c N1000
a0070d N1000A
a0070e N1000B
... ...
a00724 N1000Z
a00725 N10000
a00726 N10001
a00727 N10002
... ...
a0072e N10009
a0072f N1001
a00730 N1001A
a00731 N1001B
... ...
a00751 N10019
a00752 N1002
... ...
a00869 N10099
a0086a N101
a0086b N101A
a0086c N101AA
... ...
a00c20 N10199
a00c21 N102
a00c22 N102A
... ...
a029d8 N10999
a029d9 N11
a029da N11A
a029db N11AA
... ...
a05157 N11999
a05158 N12
... ...
a18d4f N19999
a18d50 N2
a18d51 N2A
a18d52 N2AA
... ...
a31a9e N29999
a31a9f N3
... ...
ac6a79 N9
ac6a7a N9A
... ...
adf7c7 N99999

Useful links:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icao_nnumber_converter_us-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

icao_nnumber_converter_us-0.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file icao_nnumber_converter_us-0.1.0.tar.gz.

File metadata

  • Download URL: icao_nnumber_converter_us-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for icao_nnumber_converter_us-0.1.0.tar.gz
Algorithm Hash digest
SHA256 630856607501c2720edf64538e905a02c6c3054187e0e6f9c6bf53e0915b432f
MD5 6fa3511389f2a8e4710ec87a7ca0f5e8
BLAKE2b-256 9b7fdba950ebefefa801e91301fa94cc06ac67bfd3c26ba55b735e4dc72d123c

See more details on using hashes here.

File details

Details for the file icao_nnumber_converter_us-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: icao_nnumber_converter_us-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for icao_nnumber_converter_us-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb5120cd9e844eeb4020defea3cfe1d4d9935547be99fb2e137dee69f0e92a11
MD5 1b6adc71b232d434aa17dd7e74952bc7
BLAKE2b-256 a5c18e69f31c2013dc6319ae286b2a451d544175e514023179b20e4cfd4129ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page