airline-codes 1.1.6 → 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 -1
- package/README.md +7 -0
- package/airlines.dat +6 -3
- package/airlines.json +11 -5
- package/normalize.js +43 -0
- package/package.json +1 -1
package/.github/.keepalive
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-
|
|
1
|
+
2026-10-19T12:50:12Z
|
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
|
|
@@ -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
|
|
@@ -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
|
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"}
|
|
@@ -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"}
|
|
@@ -859,10 +863,12 @@
|
|
|
859
863
|
,
|
|
860
864
|
{"id":"3258","name":"Libyan Arab Airlines","alias":"\\N","iata":"LN","icao":"LAA","callsign":"LIBAIR","country":"Libya","active":"Y"}
|
|
861
865
|
,
|
|
862
|
-
{"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"}
|
|
863
867
|
,
|
|
864
868
|
{"id":"3290","name":"Lion Mentari Airlines","alias":"\\N","iata":"JT","icao":"LNI","callsign":"LION INTER","country":"Indonesia","active":"Y"}
|
|
865
869
|
,
|
|
870
|
+
{"id":"3302","name":"Loganair","alias":"\\N","iata":"LM","icao":"LOG","callsign":"LOGAN","country":"United Kingdom","active":"Y"}
|
|
871
|
+
,
|
|
866
872
|
{"id":"3319","name":"Luftfahrtgesellschaft Walter","alias":"\\N","iata":"HE","icao":"LGW","callsign":"WALTER","country":"Germany","active":"Y"}
|
|
867
873
|
,
|
|
868
874
|
{"id":"3320","name":"Lufthansa","alias":"\\N","iata":"LH","icao":"DLH","callsign":"LUFTHANSA","country":"Germany","active":"Y"}
|
|
@@ -3407,6 +3413,8 @@
|
|
|
3407
3413
|
,
|
|
3408
3414
|
{"id":"595","name":"Atlant-Soyuz Airlines","alias":"\\N","iata":"3G","icao":"AYZ","callsign":"ATLANT-SOYUZ","country":"Russia","active":"N"}
|
|
3409
3415
|
,
|
|
3416
|
+
{"id":"596","name":"Alitalia","alias":"\\N","iata":"AZ","icao":"AZA","callsign":"ALITALIA","country":"Italy","active":"N"}
|
|
3417
|
+
,
|
|
3410
3418
|
{"id":"597","name":"Azamat","alias":"\\N","iata":"","icao":"AZB","callsign":"TUMARA","country":"Kazakhstan","active":"N"}
|
|
3411
3419
|
,
|
|
3412
3420
|
{"id":"598","name":"Arcus-Air Logistic","alias":"\\N","iata":"ZE","icao":"AZE","callsign":"ARCUS AIR","country":"Germany","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)
|
|
@@ -94,6 +103,21 @@ var ID_CORRECTIONS = {
|
|
|
94
103
|
|
|
95
104
|
var columns = ['id', 'name', 'alias', 'iata', 'icao', 'callsign', 'country', 'active'];
|
|
96
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
|
+
|
|
97
121
|
var content = fs.readFileSync('airlines.dat', 'utf8');
|
|
98
122
|
var rows = [];
|
|
99
123
|
var changed = 0;
|
|
@@ -129,6 +153,25 @@ csv.parse(content, function(err, records) {
|
|
|
129
153
|
rows.push(row);
|
|
130
154
|
});
|
|
131
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
|
+
|
|
132
175
|
// Re-serialize as CSV matching the original dat format
|
|
133
176
|
csv.stringify(rows, function(err, output) {
|
|
134
177
|
if (err) throw err;
|