airline-codes 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/.keepalive +1 -0
- package/.github/workflows/publish.yml +5 -2
- package/.github/workflows/update-data.yml +19 -2
- package/AGENTS.md +1 -5
- package/README.md +7 -0
- package/airlines.dat +14 -11
- package/airlines.json +20 -14
- package/normalize.js +52 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2026-10-19T12:50:12Z
|
|
@@ -3,6 +3,9 @@ name: Publish to npm
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches: [master]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '.github/**'
|
|
8
|
+
- '*.md'
|
|
6
9
|
workflow_dispatch:
|
|
7
10
|
|
|
8
11
|
jobs:
|
|
@@ -14,9 +17,9 @@ jobs:
|
|
|
14
17
|
- uses: actions/checkout@v4
|
|
15
18
|
- uses: actions/setup-node@v4
|
|
16
19
|
with:
|
|
17
|
-
node-version: '
|
|
20
|
+
node-version: '22'
|
|
18
21
|
registry-url: 'https://registry.npmjs.org'
|
|
19
|
-
- run: npm install -g npm@
|
|
22
|
+
- run: npm install -g npm@11
|
|
20
23
|
- run: npm install
|
|
21
24
|
- name: Publish if version not already published
|
|
22
25
|
run: |
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
- uses: actions/checkout@v4
|
|
15
15
|
- uses: actions/setup-node@v4
|
|
16
16
|
with:
|
|
17
|
-
node-version: '
|
|
17
|
+
node-version: '22'
|
|
18
18
|
registry-url: 'https://registry.npmjs.org'
|
|
19
19
|
- run: npm ci
|
|
20
20
|
- name: Fetch latest airlines.dat from OpenFlights
|
|
@@ -28,10 +28,27 @@ jobs:
|
|
|
28
28
|
git config user.name "github-actions[bot]"
|
|
29
29
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
30
30
|
if git diff --quiet airlines.dat airlines.json; then
|
|
31
|
-
echo "No data changes
|
|
31
|
+
echo "No data changes."
|
|
32
|
+
# GitHub automatically disables scheduled workflows if there are no repository commits for 60 days.
|
|
33
|
+
# If no commits have been made in the last 40 days, create a keepalive commit to reset the timer.
|
|
34
|
+
LAST_COMMIT_TS=$(git log -1 --format=%ct)
|
|
35
|
+
NOW_TS=$(date +%s)
|
|
36
|
+
DAYS_SINCE=$(( (NOW_TS - LAST_COMMIT_TS) / 86400 ))
|
|
37
|
+
echo "Days since last commit: $DAYS_SINCE"
|
|
38
|
+
if [ "$DAYS_SINCE" -ge 40 ]; then
|
|
39
|
+
echo "Repository inactive for $DAYS_SINCE days (>= 40 days); creating keepalive commit to prevent workflow disable."
|
|
40
|
+
date -u +"%Y-%m-%dT%H:%M:%SZ" > .github/.keepalive
|
|
41
|
+
git add .github/.keepalive
|
|
42
|
+
if ! git diff --staged --quiet; then
|
|
43
|
+
git commit -m "chore(keepalive): touch .github/.keepalive [skip ci]"
|
|
44
|
+
git pull --rebase origin master
|
|
45
|
+
git push origin master
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
32
48
|
else
|
|
33
49
|
npm version patch --no-git-tag-version
|
|
34
50
|
git add airlines.dat airlines.json package.json package-lock.json
|
|
35
51
|
git commit -m "chore: update airline data from OpenFlights"
|
|
52
|
+
git pull --rebase origin master
|
|
36
53
|
git push origin master
|
|
37
54
|
fi
|
package/AGENTS.md
CHANGED
|
@@ -23,8 +23,4 @@
|
|
|
23
23
|
|
|
24
24
|
## Verifying issues
|
|
25
25
|
|
|
26
|
-
Before implementing a reported data correction, verify the claim against at least one authoritative source (e.g. [airhex.com](https://airhex.com), [IATA code search](https://www.iata.org/en/publications/directories/code-search/), or [avcodes.co.uk](https://www.avcodes.co.uk/airlcodesearch.asp)).
|
|
27
|
-
|
|
28
|
-
## Commit authorship
|
|
29
|
-
|
|
30
|
-
Commits should be authored as the repo owner: `Nissan Pow <nissan.pow@gmail.com>`.
|
|
26
|
+
Before implementing a reported data correction, verify the claim against at least one authoritative source (e.g. [airhex.com](https://airhex.com), [IATA code search](https://www.iata.org/en/publications/directories/code-search/), or [avcodes.co.uk](https://www.avcodes.co.uk/airlcodesearch.asp)).
|
package/README.md
CHANGED
|
@@ -52,6 +52,13 @@ var COUNTRY_CORRECTIONS = {
|
|
|
52
52
|
|
|
53
53
|
After editing, re-run the pipeline above to apply the change.
|
|
54
54
|
|
|
55
|
+
For other field corrections, add an entry to `ID_CORRECTIONS`, keyed by the
|
|
56
|
+
existing airline ID. For missing airlines, add a row to `ADDITIONS` with a stable,
|
|
57
|
+
unique negative ID below `-10000` and a source comment. These IDs are local to
|
|
58
|
+
this package, not OpenFlights IDs. Normalization preserves historical records,
|
|
59
|
+
avoids duplicate additions on repeated runs, and uses the upstream ID once an
|
|
60
|
+
active airline with the same ICAO code and country appears upstream.
|
|
61
|
+
|
|
55
62
|
## Thanks
|
|
56
63
|
|
|
57
64
|
- [Andrew Kennedy](https://github.com/akenn/airport-codes)
|
package/airlines.dat
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
-10025,ITA Airways,\N,AZ,ITY,ITARROW,Italy,Y
|
|
2
|
+
-10027,European Air Transport Leipzig,\N,QY,BCS,POSTMAN,Germany,Y
|
|
3
|
+
-10028,Air Peace,\N,P4,APK,PEACE BIRD,Nigeria,Y
|
|
1
4
|
-1,Unknown,\N,-,N/A,\N,\N,Y
|
|
2
5
|
1,Private flight,\N,-,N/A,,,Y
|
|
3
6
|
2,135 Airways,\N,,GNL,GENERAL,United States,N
|
|
@@ -409,7 +412,7 @@
|
|
|
409
412
|
408,Avia Air N.V.,\N,,ARB,AVIAIR,Aruba,N
|
|
410
413
|
409,Air Routing International Corp.,\N,,ARC,,United States,N
|
|
411
414
|
410,Aerocondor,\N,2B,ARD,AEROCONDOR,Portugal,Y
|
|
412
|
-
411,
|
|
415
|
+
411,LATAM Airlines Colombia,\N,4C,ARE,LAN COLOMBIA,Colombia,Y
|
|
413
416
|
412,Aerolineas Argentinas,\N,AR,ARG,ARGENTINA,Argentina,Y
|
|
414
417
|
413,Arrowhead Airways,\N,,ARH,ARROWHEAD,United States,N
|
|
415
418
|
414,Aero Vics,\N,,ARI,AEROVICS,Mexico,N
|
|
@@ -594,7 +597,7 @@
|
|
|
594
597
|
593,Awsaj Aviation Services,\N,,AYS,,Libya,N
|
|
595
598
|
594,Ayeet Aviation & Tourism,\N,,AYT,AYEET,Israel,N
|
|
596
599
|
595,Atlant-Soyuz Airlines,\N,3G,AYZ,ATLANT-SOYUZ,Russia,N
|
|
597
|
-
596,Alitalia,\N,AZ,AZA,ALITALIA,Italy,
|
|
600
|
+
596,Alitalia,\N,AZ,AZA,ALITALIA,Italy,N
|
|
598
601
|
597,Azamat,\N,,AZB,TUMARA,Kazakhstan,N
|
|
599
602
|
598,Arcus-Air Logistic,\N,ZE,AZE,ARCUS AIR,Germany,N
|
|
600
603
|
599,Air Zermatt AG,\N,,AZF,AIR ZERMATT,Switzerland,N
|
|
@@ -1032,7 +1035,7 @@
|
|
|
1032
1035
|
1031,Aerolineas Mexicanas J S,\N,,LMX,LINEAS MEXICANAS,Mexico,N
|
|
1033
1036
|
1032,Air Almaty,\N,,LMY,AGLEB,Kazakhstan,N
|
|
1034
1037
|
1033,Air Almaty ZK,\N,,LMZ,ALUNK,Kazakhstan,N
|
|
1035
|
-
1034,
|
|
1038
|
+
1034,LATAM Airlines Ecuador,\N,XL,LNE,LAN ECUADOR,Ecuador,Y
|
|
1036
1039
|
1035,Airlink,\N,,LNK,LINK,South Africa,N
|
|
1037
1040
|
1036,Aerolineas Internacionales,\N,,LNT,LINEAINT,Mexico,N
|
|
1038
1041
|
1037,Alok Air,\N,,LOK,ALOK AIR,Sudan,N
|
|
@@ -3196,12 +3199,12 @@
|
|
|
3196
3199
|
3197,LACSA,\N,LR,LRC,LACSA,Costa Rica,Y
|
|
3197
3200
|
3198,LADE - Lineas Aereas Del Estado,\N,,LDE,LADE,Argentina,N
|
|
3198
3201
|
3199,LAI - Linea Aerea IAACA,\N,KG,BNX,AIR BARINAS,Venezuela,N
|
|
3199
|
-
3200,
|
|
3200
|
-
3201,
|
|
3202
|
+
3200,LATAM Airlines,\N,LA,LAN,LAN,Chile,Y
|
|
3203
|
+
3201,LATAM Airlines Argentina,\N,4M,DSM,LAN AR,Argentina,N
|
|
3201
3204
|
3202,LAN Cargo,\N,,LCO,LAN CARGO,Chile,N
|
|
3202
3205
|
3203,LAN Dominica,\N,,LNC,LANCANA,Dominican Republic,N
|
|
3203
|
-
3204,
|
|
3204
|
-
3205,
|
|
3206
|
+
3204,LATAM Airlines Chile,\N,LU,LXP,LANEX,Chile,Y
|
|
3207
|
+
3205,LATAM Airlines Peru,\N,LP,LPE,LANPERU,Peru,Y
|
|
3205
3208
|
3206,LANSA,\N,,LSA,INTERNACIONAL,Dominican Republic,N
|
|
3206
3209
|
3207,LAP Colombia - Lineas Aereas Petroleras,\N,,APT,S.A.,LAP,N
|
|
3207
3210
|
3208,LASTP,\N,,OTN,LASTP,S,N
|
|
@@ -3282,7 +3285,7 @@
|
|
|
3282
3285
|
3284,Lineas Aereas del Humaya,\N,,UMA,HUMAYA,Mexico,N
|
|
3283
3286
|
3285,Linex,\N,,LEC,LECA,Central African Republic,N
|
|
3284
3287
|
3286,Linhas Aereas Santomenses,\N,,SMS,SANTOMENSES,S,N
|
|
3285
|
-
3287,Linhas A,\N,
|
|
3288
|
+
3287,Linhas A,\N,TM,LAM,MOZAMBIQUE,Mozambique,Y
|
|
3286
3289
|
3288,Link Airways of Australia,\N,,LAW,,Australia,N
|
|
3287
3290
|
3289,Lion Air Services,\N,,WGT,WORLDGATE,United Kingdom,N
|
|
3288
3291
|
3290,Lion Mentari Airlines,\N,JT,LNI,LION INTER,Indonesia,Y
|
|
@@ -3297,7 +3300,7 @@
|
|
|
3297
3300
|
3299,Lockheed DUATS,\N,,XDD,,United States,N
|
|
3298
3301
|
3300,Lockheed Martin Aeronautics,\N,,CBD,CATBIRD,United States,N
|
|
3299
3302
|
3301,Lockheed Martin Aeronautics Company,\N,,LNG,LIGHTNING,United States,N
|
|
3300
|
-
3302,
|
|
3303
|
+
3302,Loganair,\N,LM,LOG,LOGAN,United Kingdom,Y
|
|
3301
3304
|
3303,Lom Praha Flying School,\N,,CLV,AEROTRAINING,Czech Republic,N
|
|
3302
3305
|
3304,Lomas Helicopters,\N,,LMS,LOMAS,United Kingdom,N
|
|
3303
3306
|
3305,London City Airport Jet Centre,\N,,LCY,LONDON CITY,United Kingdom,N
|
|
@@ -4855,7 +4858,7 @@
|
|
|
4855
4858
|
4864,Trans International Express Aviation,\N,,BAP,BIG APPLE,United States,N
|
|
4856
4859
|
4865,TAG Aviation USA,\N,,TAG,TAG U-S,United States,N
|
|
4857
4860
|
4866,Talair,\N,,TAL,TALAIR,Papua New Guinea,N
|
|
4858
|
-
4867,
|
|
4861
|
+
4867,LATAM Airlines Brasil,\N,JJ,TAM,TAM,Brazil,Y
|
|
4859
4862
|
4868,Transaustralian Air Express,\N,,AUC,AUSCARGO,Australia,N
|
|
4860
4863
|
4869,TAP Portugal,TAP Air Portugal,TP,TAP,AIR PORTUGAL,Portugal,Y
|
|
4861
4864
|
4870,Tunisair,\N,TU,TAR,TUNAIR,Tunisia,Y
|
|
@@ -5144,7 +5147,7 @@
|
|
|
5144
5147
|
5153,Transcontinental Airlines,\N,,KRA,REGATA,Kazakhstan,N
|
|
5145
5148
|
5154,Transaviabaltika,\N,,KTB,TRANSBALTIKA,Lithuania,N
|
|
5146
5149
|
5155,Transair-Gyraintiee,\N,,KTS,KOTAIR,Russia,N
|
|
5147
|
-
5156,
|
|
5150
|
+
5156,LATAM Airlines Paraguay,\N,PZ,LAP,PARAGUAYA,Paraguay,Y
|
|
5148
5151
|
5157,The Lancair Company,\N,,LCC,LANCAIR,United States,N
|
|
5149
5152
|
5158,The Army Aviation Heritage Foundation,\N,,LEG,LEGACY,United States,N
|
|
5150
5153
|
5159,Top Sky International,\N,,LKW,TOPINTER,Indonesia,N
|
package/airlines.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{"id":"-10025","name":"ITA Airways","alias":"\\N","iata":"AZ","icao":"ITY","callsign":"ITARROW","country":"Italy","active":"Y"}
|
|
3
|
+
,
|
|
4
|
+
{"id":"-10027","name":"European Air Transport Leipzig","alias":"\\N","iata":"QY","icao":"BCS","callsign":"POSTMAN","country":"Germany","active":"Y"}
|
|
5
|
+
,
|
|
6
|
+
{"id":"-10028","name":"Air Peace","alias":"\\N","iata":"P4","icao":"APK","callsign":"PEACE BIRD","country":"Nigeria","active":"Y"}
|
|
7
|
+
,
|
|
2
8
|
{"id":"-1","name":"Unknown","alias":"\\N","iata":"-","icao":"N/A","callsign":"\\N","country":"\\N","active":"Y"}
|
|
3
9
|
,
|
|
4
10
|
{"id":"1","name":"Private flight","alias":"\\N","iata":"-","icao":"N/A","callsign":"","country":"","active":"Y"}
|
|
@@ -165,7 +171,7 @@
|
|
|
165
171
|
,
|
|
166
172
|
{"id":"410","name":"Aerocondor","alias":"\\N","iata":"2B","icao":"ARD","callsign":"AEROCONDOR","country":"Portugal","active":"Y"}
|
|
167
173
|
,
|
|
168
|
-
{"id":"411","name":"
|
|
174
|
+
{"id":"411","name":"LATAM Airlines Colombia","alias":"\\N","iata":"4C","icao":"ARE","callsign":"LAN COLOMBIA","country":"Colombia","active":"Y"}
|
|
169
175
|
,
|
|
170
176
|
{"id":"412","name":"Aerolineas Argentinas","alias":"\\N","iata":"AR","icao":"ARG","callsign":"ARGENTINA","country":"Argentina","active":"Y"}
|
|
171
177
|
,
|
|
@@ -219,8 +225,6 @@
|
|
|
219
225
|
,
|
|
220
226
|
{"id":"576","name":"AirAsia","alias":"Air Asia","iata":"AK","icao":"AXM","callsign":"ASIAN EXPRESS","country":"Malaysia","active":"Y"}
|
|
221
227
|
,
|
|
222
|
-
{"id":"596","name":"Alitalia","alias":"\\N","iata":"AZ","icao":"AZA","callsign":"ALITALIA","country":"Italy","active":"Y"}
|
|
223
|
-
,
|
|
224
228
|
{"id":"603","name":"Amaszonas","alias":"\\N","iata":"Z8","icao":"AZN","callsign":"","country":"Bolivia","active":"Y"}
|
|
225
229
|
,
|
|
226
230
|
{"id":"608","name":"Air Zimbabwe","alias":"\\N","iata":"UM","icao":"AZW","callsign":"AIR ZIMBABWE","country":"Zimbabwe","active":"Y"}
|
|
@@ -303,7 +307,7 @@
|
|
|
303
307
|
,
|
|
304
308
|
{"id":"1017","name":"Air Alfa","alias":"\\N","iata":"","icao":"LFA","callsign":"","country":"Turkey","active":"Y"}
|
|
305
309
|
,
|
|
306
|
-
{"id":"1034","name":"
|
|
310
|
+
{"id":"1034","name":"LATAM Airlines Ecuador","alias":"\\N","iata":"XL","icao":"LNE","callsign":"LAN ECUADOR","country":"Ecuador","active":"Y"}
|
|
307
311
|
,
|
|
308
312
|
{"id":"1048","name":"Atlantis European Airways","alias":"\\N","iata":"TD","icao":"LUR","callsign":"","country":"Armenia","active":"Y"}
|
|
309
313
|
,
|
|
@@ -837,13 +841,11 @@
|
|
|
837
841
|
,
|
|
838
842
|
{"id":"3197","name":"LACSA","alias":"\\N","iata":"LR","icao":"LRC","callsign":"LACSA","country":"Costa Rica","active":"Y"}
|
|
839
843
|
,
|
|
840
|
-
{"id":"3200","name":"
|
|
841
|
-
,
|
|
842
|
-
{"id":"3201","name":"LAN Argentina","alias":"\\N","iata":"4M","icao":"DSM","callsign":"LAN AR","country":"Argentina","active":"Y"}
|
|
844
|
+
{"id":"3200","name":"LATAM Airlines","alias":"\\N","iata":"LA","icao":"LAN","callsign":"LAN","country":"Chile","active":"Y"}
|
|
843
845
|
,
|
|
844
|
-
{"id":"3204","name":"
|
|
846
|
+
{"id":"3204","name":"LATAM Airlines Chile","alias":"\\N","iata":"LU","icao":"LXP","callsign":"LANEX","country":"Chile","active":"Y"}
|
|
845
847
|
,
|
|
846
|
-
{"id":"3205","name":"
|
|
848
|
+
{"id":"3205","name":"LATAM Airlines Peru","alias":"\\N","iata":"LP","icao":"LPE","callsign":"LANPERU","country":"Peru","active":"Y"}
|
|
847
849
|
,
|
|
848
850
|
{"id":"3210","name":"LOT Polish Airlines","alias":"\\N","iata":"LO","icao":"LOT","callsign":"POLLOT","country":"Poland","active":"Y"}
|
|
849
851
|
,
|
|
@@ -861,10 +863,12 @@
|
|
|
861
863
|
,
|
|
862
864
|
{"id":"3258","name":"Libyan Arab Airlines","alias":"\\N","iata":"LN","icao":"LAA","callsign":"LIBAIR","country":"Libya","active":"Y"}
|
|
863
865
|
,
|
|
864
|
-
{"id":"3287","name":"Linhas A","alias":"\\N","iata":"
|
|
866
|
+
{"id":"3287","name":"Linhas A","alias":"\\N","iata":"TM","icao":"LAM","callsign":"MOZAMBIQUE","country":"Mozambique","active":"Y"}
|
|
865
867
|
,
|
|
866
868
|
{"id":"3290","name":"Lion Mentari Airlines","alias":"\\N","iata":"JT","icao":"LNI","callsign":"LION INTER","country":"Indonesia","active":"Y"}
|
|
867
869
|
,
|
|
870
|
+
{"id":"3302","name":"Loganair","alias":"\\N","iata":"LM","icao":"LOG","callsign":"LOGAN","country":"United Kingdom","active":"Y"}
|
|
871
|
+
,
|
|
868
872
|
{"id":"3319","name":"Luftfahrtgesellschaft Walter","alias":"\\N","iata":"HE","icao":"LGW","callsign":"WALTER","country":"Germany","active":"Y"}
|
|
869
873
|
,
|
|
870
874
|
{"id":"3320","name":"Lufthansa","alias":"\\N","iata":"LH","icao":"DLH","callsign":"LUFTHANSA","country":"Germany","active":"Y"}
|
|
@@ -1235,7 +1239,7 @@
|
|
|
1235
1239
|
,
|
|
1236
1240
|
{"id":"4863","name":"TAME","alias":"\\N","iata":"EQ","icao":"TAE","callsign":"TAME","country":"Ecuador","active":"Y"}
|
|
1237
1241
|
,
|
|
1238
|
-
{"id":"4867","name":"
|
|
1242
|
+
{"id":"4867","name":"LATAM Airlines Brasil","alias":"\\N","iata":"JJ","icao":"TAM","callsign":"TAM","country":"Brazil","active":"Y"}
|
|
1239
1243
|
,
|
|
1240
1244
|
{"id":"4869","name":"TAP Portugal","alias":"TAP Air Portugal","iata":"TP","icao":"TAP","callsign":"AIR PORTUGAL","country":"Portugal","active":"Y"}
|
|
1241
1245
|
,
|
|
@@ -1295,7 +1299,7 @@
|
|
|
1295
1299
|
,
|
|
1296
1300
|
{"id":"5146","name":"Turkish Air Force","alias":"\\N","iata":"","icao":"HVK","callsign":"TURKISH AIRFORCE","country":"Turkey","active":"Y"}
|
|
1297
1301
|
,
|
|
1298
|
-
{"id":"5156","name":"
|
|
1302
|
+
{"id":"5156","name":"LATAM Airlines Paraguay","alias":"\\N","iata":"PZ","icao":"LAP","callsign":"PARAGUAYA","country":"Paraguay","active":"Y"}
|
|
1299
1303
|
,
|
|
1300
1304
|
{"id":"5160","name":"Trans States Airlines","alias":"\\N","iata":"AX","icao":"LOF","callsign":"WATERSKI","country":"United States","active":"Y"}
|
|
1301
1305
|
,
|
|
@@ -3409,6 +3413,8 @@
|
|
|
3409
3413
|
,
|
|
3410
3414
|
{"id":"595","name":"Atlant-Soyuz Airlines","alias":"\\N","iata":"3G","icao":"AYZ","callsign":"ATLANT-SOYUZ","country":"Russia","active":"N"}
|
|
3411
3415
|
,
|
|
3416
|
+
{"id":"596","name":"Alitalia","alias":"\\N","iata":"AZ","icao":"AZA","callsign":"ALITALIA","country":"Italy","active":"N"}
|
|
3417
|
+
,
|
|
3412
3418
|
{"id":"597","name":"Azamat","alias":"\\N","iata":"","icao":"AZB","callsign":"TUMARA","country":"Kazakhstan","active":"N"}
|
|
3413
3419
|
,
|
|
3414
3420
|
{"id":"598","name":"Arcus-Air Logistic","alias":"\\N","iata":"ZE","icao":"AZE","callsign":"ARCUS AIR","country":"Germany","active":"N"}
|
|
@@ -7995,6 +8001,8 @@
|
|
|
7995
8001
|
,
|
|
7996
8002
|
{"id":"3199","name":"LAI - Linea Aerea IAACA","alias":"\\N","iata":"KG","icao":"BNX","callsign":"AIR BARINAS","country":"Venezuela","active":"N"}
|
|
7997
8003
|
,
|
|
8004
|
+
{"id":"3201","name":"LATAM Airlines Argentina","alias":"\\N","iata":"4M","icao":"DSM","callsign":"LAN AR","country":"Argentina","active":"N"}
|
|
8005
|
+
,
|
|
7998
8006
|
{"id":"3202","name":"LAN Cargo","alias":"\\N","iata":"","icao":"LCO","callsign":"LAN CARGO","country":"Chile","active":"N"}
|
|
7999
8007
|
,
|
|
8000
8008
|
{"id":"3203","name":"LAN Dominica","alias":"\\N","iata":"","icao":"LNC","callsign":"LANCANA","country":"Dominican Republic","active":"N"}
|
|
@@ -8169,8 +8177,6 @@
|
|
|
8169
8177
|
,
|
|
8170
8178
|
{"id":"3301","name":"Lockheed Martin Aeronautics Company","alias":"\\N","iata":"","icao":"LNG","callsign":"LIGHTNING","country":"United States","active":"N"}
|
|
8171
8179
|
,
|
|
8172
|
-
{"id":"3302","name":"Logan Air","alias":"\\N","iata":"","icao":"LOG","callsign":"LOGAN","country":"United Kingdom","active":"N"}
|
|
8173
|
-
,
|
|
8174
8180
|
{"id":"3303","name":"Lom Praha Flying School","alias":"\\N","iata":"","icao":"CLV","callsign":"AEROTRAINING","country":"Czech Republic","active":"N"}
|
|
8175
8181
|
,
|
|
8176
8182
|
{"id":"3304","name":"Lomas Helicopters","alias":"\\N","iata":"","icao":"LMS","callsign":"LOMAS","country":"United Kingdom","active":"N"}
|
package/normalize.js
CHANGED
|
@@ -31,6 +31,15 @@ var COUNTRY_CORRECTIONS = {
|
|
|
31
31
|
// Keys are airline IDs (as strings). Values are objects with field overrides.
|
|
32
32
|
// Fields: name, alias, iata, icao, callsign, country, active
|
|
33
33
|
var ID_CORRECTIONS = {
|
|
34
|
+
// #25: Alitalia ceased operations in October 2021; ITA is a separate airline.
|
|
35
|
+
// https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32023D0628(01)
|
|
36
|
+
'596': { active: 'N' },
|
|
37
|
+
// #26: Loganair is operating and uses LM (upstream omits its IATA code).
|
|
38
|
+
// https://www.loganair.co.uk/helpcentre/conditions-of-carriage/
|
|
39
|
+
'3302': { name: 'Loganair', iata: 'LM', active: 'Y' },
|
|
40
|
+
// The Mozambique/LAM record incorrectly uses Loganair's LM; LAM uses TM.
|
|
41
|
+
// https://www.iata.org/en/about/members/airline-list/?search=LAM
|
|
42
|
+
'3287': { iata: 'TM' },
|
|
34
43
|
// Alaska Airlines: upstream has country="ALASKA" (callsign leaked into country field)
|
|
35
44
|
'439': { country: 'United States' },
|
|
36
45
|
// Dragonair: upstream has country="DRAGON" (callsign leaked into country field)
|
|
@@ -81,10 +90,34 @@ var ID_CORRECTIONS = {
|
|
|
81
90
|
'19849': { iata: 'GX' }, // Guangxi Beibu Gulf Airlines - correct code is GX not UQ
|
|
82
91
|
// Outdated airline assignments (upstream OpenFlights not yet updated):
|
|
83
92
|
'4239': { name: 'Volaris El Salvador', iata: 'N3', callsign: 'VOLSAL', country: 'El Salvador', active: 'Y' }, // VOS reassigned from Rovos Air (South Africa) to Volaris El Salvador
|
|
93
|
+
// LAN / TAM rebranding to LATAM:
|
|
94
|
+
'411': { name: 'LATAM Airlines Colombia', callsign: 'LAN COLOMBIA', country: 'Colombia' }, // Aires rebranded to LATAM Colombia; fix corrupted callsign and country " S.A."
|
|
95
|
+
'1034': { name: 'LATAM Airlines Ecuador' }, // Aerolane rebranded to LATAM Airlines Ecuador
|
|
96
|
+
'3200': { name: 'LATAM Airlines' }, // LAN Airlines rebranded to LATAM Airlines
|
|
97
|
+
'3201': { name: 'LATAM Airlines Argentina', active: 'N' }, // LAN Argentina rebranded to LATAM Airlines Argentina; ceased operations 2020
|
|
98
|
+
'3204': { name: 'LATAM Airlines Chile' }, // LAN Express rebranded to LATAM Airlines Chile
|
|
99
|
+
'3205': { name: 'LATAM Airlines Peru' }, // LAN Peru rebranded to LATAM Airlines Peru
|
|
100
|
+
'4867': { name: 'LATAM Airlines Brasil' }, // TAM Brazilian Airlines rebranded to LATAM Airlines Brasil
|
|
101
|
+
'5156': { name: 'LATAM Airlines Paraguay' }, // TAM Mercosur rebranded to LATAM Airlines Paraguay
|
|
84
102
|
};
|
|
85
103
|
|
|
86
104
|
var columns = ['id', 'name', 'alias', 'iata', 'icao', 'callsign', 'country', 'active'];
|
|
87
105
|
|
|
106
|
+
// Stable local IDs in a negative range, separate from positive OpenFlights IDs
|
|
107
|
+
// and its -1 Unknown sentinel. Keep historical predecessor records intact.
|
|
108
|
+
var ADDITIONS = [
|
|
109
|
+
// #25: https://www.iata.org/en/about/members/airline-list/ita-airways/565/
|
|
110
|
+
// Callsign: https://www.avcodes.co.uk/details.asp?ID=29704
|
|
111
|
+
['-10025', 'ITA Airways', '\\N', 'AZ', 'ITY', 'ITARROW', 'Italy', 'Y'],
|
|
112
|
+
// #27: the Belgian predecessor (2252) remains inactive.
|
|
113
|
+
// https://www.iata.org/en/about/members/airline-list/european-air-transport/534/
|
|
114
|
+
// Callsign: https://www.avcodes.co.uk/details.asp?ID=30177
|
|
115
|
+
['-10027', 'European Air Transport Leipzig', '\\N', 'QY', 'BCS', 'POSTMAN', 'Germany', 'Y'],
|
|
116
|
+
// #28: https://www.iata.org/en/about/members/airline-list/air-peace/500/
|
|
117
|
+
// Callsign: https://www.avcodes.co.uk/callsignlistres.asp
|
|
118
|
+
['-10028', 'Air Peace', '\\N', 'P4', 'APK', 'PEACE BIRD', 'Nigeria', 'Y'],
|
|
119
|
+
];
|
|
120
|
+
|
|
88
121
|
var content = fs.readFileSync('airlines.dat', 'utf8');
|
|
89
122
|
var rows = [];
|
|
90
123
|
var changed = 0;
|
|
@@ -120,6 +153,25 @@ csv.parse(content, function(err, records) {
|
|
|
120
153
|
rows.push(row);
|
|
121
154
|
});
|
|
122
155
|
|
|
156
|
+
// Prepend additions so current carriers take precedence in code lookups.
|
|
157
|
+
// Avoid duplicates on repeat runs or when upstream adds the current airline;
|
|
158
|
+
// country and active status distinguish historical holders of the same ICAO.
|
|
159
|
+
ADDITIONS.slice().reverse().forEach(function(addition) {
|
|
160
|
+
var existing = rows.find(function(row) { return row[0] === addition[0]; });
|
|
161
|
+
if (existing && (existing[4] !== addition[4] || existing[6] !== addition[6])) {
|
|
162
|
+
throw new Error('Local airline ID collision: ' + addition[0]);
|
|
163
|
+
}
|
|
164
|
+
var upstream = rows.find(function(row) {
|
|
165
|
+
return row[0] !== addition[0] && row[4] === addition[4] &&
|
|
166
|
+
row[6] === addition[6] && row[7] === 'Y';
|
|
167
|
+
});
|
|
168
|
+
var selected = upstream || existing || addition;
|
|
169
|
+
rows = rows.filter(function(row) {
|
|
170
|
+
return row[0] !== addition[0] && row !== selected;
|
|
171
|
+
});
|
|
172
|
+
rows.unshift(selected);
|
|
173
|
+
});
|
|
174
|
+
|
|
123
175
|
// Re-serialize as CSV matching the original dat format
|
|
124
176
|
csv.stringify(rows, function(err, output) {
|
|
125
177
|
if (err) throw err;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airline-codes",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Airline codes (IATA) and information pulled from OpenFlights.org.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"JSONStream": "^1.0.4",
|
|
31
31
|
"backbone": "^1.1.2",
|
|
32
|
-
"csv": "^
|
|
32
|
+
"csv": "^6.6.3",
|
|
33
33
|
"lodash": "^4.17.21"
|
|
34
34
|
}
|
|
35
35
|
}
|