diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9c8702 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ + +itu_prefixes/*.tsv diff --git a/itu_prefixes/itu_prefixes_2021-07-02.csv b/itu_prefixes/itu_prefixes_2021-07-02.csv new file mode 100644 index 0000000..371e026 --- /dev/null +++ b/itu_prefixes/itu_prefixes_2021-07-02.csv @@ -0,0 +1,953 @@ +Series Allocated to +2AA - 2AZ United Kingdom of Great Britain and Northern Ireland +2BA - 2BZ United Kingdom of Great Britain and Northern Ireland +2CA - 2CZ United Kingdom of Great Britain and Northern Ireland +2DA - 2DZ United Kingdom of Great Britain and Northern Ireland +2EA - 2EZ United Kingdom of Great Britain and Northern Ireland +2FA - 2FZ United Kingdom of Great Britain and Northern Ireland +2GA - 2GZ United Kingdom of Great Britain and Northern Ireland +2HA - 2HZ United Kingdom of Great Britain and Northern Ireland +2IA - 2IZ United Kingdom of Great Britain and Northern Ireland +2JA - 2JZ United Kingdom of Great Britain and Northern Ireland +2KA - 2KZ United Kingdom of Great Britain and Northern Ireland +2LA - 2LZ United Kingdom of Great Britain and Northern Ireland +2MA - 2MZ United Kingdom of Great Britain and Northern Ireland +2NA - 2NZ United Kingdom of Great Britain and Northern Ireland +2OA - 2OZ United Kingdom of Great Britain and Northern Ireland +2PA - 2PZ United Kingdom of Great Britain and Northern Ireland +2QA - 2QZ United Kingdom of Great Britain and Northern Ireland +2RA - 2RZ United Kingdom of Great Britain and Northern Ireland +2SA - 2SZ United Kingdom of Great Britain and Northern Ireland +2TA - 2TZ United Kingdom of Great Britain and Northern Ireland +2UA - 2UZ United Kingdom of Great Britain and Northern Ireland +2VA - 2VZ United Kingdom of Great Britain and Northern Ireland +2WA - 2WZ United Kingdom of Great Britain and Northern Ireland +2XA - 2XZ United Kingdom of Great Britain and Northern Ireland +2YA - 2YZ United Kingdom of Great Britain and Northern Ireland +2ZA - 2ZZ United Kingdom of Great Britain and Northern Ireland +3AA - 3AZ Monaco (Principality of) +3BA - 3BZ Mauritius (Republic of) +3CA - 3CZ Equatorial Guinea (Republic of) +3DA - 3DM Eswatini (Kingdom of) +3DN - 3DZ Fiji (Republic of) +3EA - 3EZ Panama (Republic of) +3FA - 3FZ Panama (Republic of) +3GA - 3GZ Chile +3HA - 3HZ China (People's Republic of) +3IA - 3IZ China (People's Republic of) +3JA - 3JZ China (People's Republic of) +3KA - 3KZ China (People's Republic of) +3LA - 3LZ China (People's Republic of) +3MA - 3MZ China (People's Republic of) +3NA - 3NZ China (People's Republic of) +3OA - 3OZ China (People's Republic of) +3PA - 3PZ China (People's Republic of) +3QA - 3QZ China (People's Republic of) +3RA - 3RZ China (People's Republic of) +3SA - 3SZ China (People's Republic of) +3TA - 3TZ China (People's Republic of) +3UA - 3UZ China (People's Republic of) +3VA - 3VZ Tunisia +3WA - 3WZ Viet Nam (Socialist Republic of) +3XA - 3XZ Guinea (Republic of) +3YA - 3YZ Norway +3ZA - 3ZZ Poland (Republic of) +4AA - 4AZ Mexico +4BA - 4BZ Mexico +4CA - 4CZ Mexico +4DA - 4DZ Philippines (Republic of the) +4EA - 4EZ Philippines (Republic of the) +4FA - 4FZ Philippines (Republic of the) +4GA - 4GZ Philippines (Republic of the) +4HA - 4HZ Philippines (Republic of the) +4IA - 4IZ Philippines (Republic of the) +4JA - 4JZ Azerbaijan (Republic of) +4KA - 4KZ Azerbaijan (Republic of) +4LA - 4LZ Georgia +4MA - 4MZ Venezuela (Bolivarian Republic of) +4OA - 4OZ Montenegro +4PA - 4PZ Sri Lanka (Democratic Socialist Republic of) +4QA - 4QZ Sri Lanka (Democratic Socialist Republic of) +4RA - 4RZ Sri Lanka (Democratic Socialist Republic of) +4SA - 4SZ Sri Lanka (Democratic Socialist Republic of) +4TA - 4TZ Peru +4UA - 4UZ United Nations +4VA - 4VZ Haiti (Republic of) +4WA - 4WZ Timor-Leste (Democratic Republic of) +4XA - 4XZ Israel (State of) +4YA - 4YZ International Civil Aviation Organization +4ZA - 4ZZ Israel (State of) +5AA - 5AZ Libya (State of) +5BA - 5BZ Cyprus (Republic of) +5CA - 5CZ Morocco (Kingdom of) +5DA - 5DZ Morocco (Kingdom of) +5EA - 5EZ Morocco (Kingdom of) +5FA - 5FZ Morocco (Kingdom of) +5GA - 5GZ Morocco (Kingdom of) +5HA - 5HZ Tanzania (United Republic of) +5IA - 5IZ Tanzania (United Republic of) +5JA - 5JZ Colombia (Republic of) +5KA - 5KZ Colombia (Republic of) +5LA - 5LZ Liberia (Republic of) +5MA - 5MZ Liberia (Republic of) +5NA - 5NZ Nigeria (Federal Republic of) +5OA - 5OZ Nigeria (Federal Republic of) +5PA - 5PZ Denmark +5QA - 5QZ Denmark +5RA - 5RZ Madagascar (Republic of) +5SA - 5SZ Madagascar (Republic of) +5TA - 5TZ Mauritania (Islamic Republic of) +5UA - 5UZ Niger (Republic of the) +5VA - 5VZ Togolese Republic +5WA - 5WZ Samoa (Independent State of) +5XA - 5XZ Uganda (Republic of) +5YA - 5YZ Kenya (Republic of) +5ZA - 5ZZ Kenya (Republic of) +6AA - 6AZ Egypt (Arab Republic of) +6BA - 6BZ Egypt (Arab Republic of) +6CA - 6CZ Syrian Arab Republic +6DA - 6DZ Mexico +6EA - 6EZ Mexico +6FA - 6FZ Mexico +6GA - 6GZ Mexico +6HA - 6HZ Mexico +6IA - 6IZ Mexico +6JA - 6JZ Mexico +6KA - 6KZ Korea (Republic of) +6LA - 6LZ Korea (Republic of) +6MA - 6MZ Korea (Republic of) +6NA - 6NZ Korea (Republic of) +6OA - 6OZ Somalia (Federal Republic of) +6PA - 6PZ Pakistan (Islamic Republic of) +6QA - 6QZ Pakistan (Islamic Republic of) +6RA - 6RZ Pakistan (Islamic Republic of) +6SA - 6SZ Pakistan (Islamic Republic of) +6TA - 6TZ Sudan (Republic of the) +6UA - 6UZ Sudan (Republic of the) +6VA - 6VZ Senegal (Republic of) +6WA - 6WZ Senegal (Republic of) +6XA - 6XZ Madagascar (Republic of) +6YA - 6YZ Jamaica +6ZA - 6ZZ Liberia (Republic of) +7AA - 7AZ Indonesia (Republic of) +7BA - 7BZ Indonesia (Republic of) +7CA - 7CZ Indonesia (Republic of) +7DA - 7DZ Indonesia (Republic of) +7EA - 7EZ Indonesia (Republic of) +7FA - 7FZ Indonesia (Republic of) +7GA - 7GZ Indonesia (Republic of) +7HA - 7HZ Indonesia (Republic of) +7IA - 7IZ Indonesia (Republic of) +7JA - 7JZ Japan +7KA - 7KZ Japan +7LA - 7LZ Japan +7MA - 7MZ Japan +7NA - 7NZ Japan +7OA - 7OZ Yemen (Republic of) +7PA - 7PZ Lesotho (Kingdom of) +7QA - 7QZ Malawi +7RA - 7RZ Algeria (People's Democratic Republic of) +7SA - 7SZ Sweden +7TA - 7TZ Algeria (People's Democratic Republic of) +7UA - 7UZ Algeria (People's Democratic Republic of) +7VA - 7VZ Algeria (People's Democratic Republic of) +7WA - 7WZ Algeria (People's Democratic Republic of) +7XA - 7XZ Algeria (People's Democratic Republic of) +7YA - 7YZ Algeria (People's Democratic Republic of) +7ZA - 7ZZ Saudi Arabia (Kingdom of) +8AA - 8AZ Indonesia (Republic of) +8BA - 8BZ Indonesia (Republic of) +8CA - 8CZ Indonesia (Republic of) +8DA - 8DZ Indonesia (Republic of) +8EA - 8EZ Indonesia (Republic of) +8FA - 8FZ Indonesia (Republic of) +8GA - 8GZ Indonesia (Republic of) +8HA - 8HZ Indonesia (Republic of) +8IA - 8IZ Indonesia (Republic of) +8JA - 8JZ Japan +8KA - 8KZ Japan +8LA - 8LZ Japan +8MA - 8MZ Japan +8NA - 8NZ Japan +8OA - 8OZ Botswana (Republic of) +8PA - 8PZ Barbados +8QA - 8QZ Maldives (Republic of) +8RA - 8RZ Guyana +8SA - 8SZ Sweden +8TA - 8TZ India (Republic of) +8UA - 8UZ India (Republic of) +8VA - 8VZ India (Republic of) +8WA - 8WZ India (Republic of) +8XA - 8XZ India (Republic of) +8YA - 8YZ India (Republic of) +8ZA - 8ZZ Saudi Arabia (Kingdom of) +9AA - 9AZ Croatia (Republic of) +9BA - 9BZ Iran (Islamic Republic of) +9CA - 9CZ Iran (Islamic Republic of) +9DA - 9DZ Iran (Islamic Republic of) +9EA - 9EZ Ethiopia (Federal Democratic Republic of) +9FA - 9FZ Ethiopia (Federal Democratic Republic of) +9GA - 9GZ Ghana +9HA - 9HZ Malta +9IA - 9IZ Zambia (Republic of) +9JA - 9JZ Zambia (Republic of) +9KA - 9KZ Kuwait (State of) +9LA - 9LZ Sierra Leone +9MA - 9MZ Malaysia +9NA - 9NZ Nepal (Federal Democratic Republic of) +9OA - 9OZ Democratic Republic of the Congo +9PA - 9PZ Democratic Republic of the Congo +9QA - 9QZ Democratic Republic of the Congo +9RA - 9RZ Democratic Republic of the Congo +9SA - 9SZ Democratic Republic of the Congo +9TA - 9TZ Democratic Republic of the Congo +9UA - 9UZ Burundi (Republic of) +9VA - 9VZ Singapore (Republic of) +9WA - 9WZ Malaysia +9XA - 9XZ Rwanda (Republic of) +9YA - 9YZ Trinidad and Tobago +9ZA - 9ZZ Trinidad and Tobago +A2A - A2Z Botswana (Republic of) +A3A - A3Z Tonga (Kingdom of) +A4A - A4Z Oman (Sultanate of) +A5A - A5Z Bhutan (Kingdom of) +A6A - A6Z United Arab Emirates +A7A - A7Z Qatar (State of) +A8A - A8Z Liberia (Republic of) +A9A - A9Z Bahrain (Kingdom of) +AAA - AAZ United States of America +ABA - ABZ United States of America +ACA - ACZ United States of America +ADA - ADZ United States of America +AEA - AEZ United States of America +AFA - AFZ United States of America +AGA - AGZ United States of America +AHA - AHZ United States of America +AIA - AIZ United States of America +AJA - AJZ United States of America +AKA - AKZ United States of America +ALA - ALZ United States of America +AMA - AMZ Spain +ANA - ANZ Spain +AOA - AOZ Spain +APA - APZ Pakistan (Islamic Republic of) +AQA - AQZ Pakistan (Islamic Republic of) +ARA - ARZ Pakistan (Islamic Republic of) +ASA - ASZ Pakistan (Islamic Republic of) +ATA - ATZ India (Republic of) +AUA - AUZ India (Republic of) +AVA - AVZ India (Republic of) +AWA - AWZ India (Republic of) +AXA - AXZ Australia +AYA - AYZ Argentine Republic +AZA - AZZ Argentine Republic +BAA - BAZ China (People's Republic of) +BBA - BBZ China (People's Republic of) +BCA - BCZ China (People's Republic of) +BDA - BDZ China (People's Republic of) +BEA - BEZ China (People's Republic of) +BFA - BFZ China (People's Republic of) +BGA - BGZ China (People's Republic of) +BHA - BHZ China (People's Republic of) +BIA - BIZ China (People's Republic of) +BJA - BJZ China (People's Republic of) +BKA - BKZ China (People's Republic of) +BLA - BLZ China (People's Republic of) +BMA - BMZ China (People's Republic of) +BNA - BNZ China (People's Republic of) +BOA - BOZ China (People's Republic of) +BPA - BPZ China (People's Republic of) +BQA - BQZ China (People's Republic of) +BRA - BRZ China (People's Republic of) +BSA - BSZ China (People's Republic of) +BTA - BTZ China (People's Republic of) +BUA - BUZ China (People's Republic of) +BVA - BVZ China (People's Republic of) +BWA - BWZ China (People's Republic of) +BXA - BXZ China (People's Republic of) +BYA - BYZ China (People's Republic of) +BZA - BZZ China (People's Republic of) +C2A - C2Z Nauru (Republic of) +C3A - C3Z Andorra (Principality of) +C4A - C4Z Cyprus (Republic of) +C5A - C5Z Gambia (Republic of the) +C6A - C6Z Bahamas (Commonwealth of the) +C7A - C7Z World Meteorological Organization +C8A - C8Z Mozambique (Republic of) +C9A - C9Z Mozambique (Republic of) +CAA - CAZ Chile +CBA - CBZ Chile +CCA - CCZ Chile +CDA - CDZ Chile +CEA - CEZ Chile +CFA - CFZ Canada +CGA - CGZ Canada +CHA - CHZ Canada +CIA - CIZ Canada +CJA - CJZ Canada +CKA - CKZ Canada +CLA - CLZ Cuba +CMA - CMZ Cuba +CNA - CNZ Morocco (Kingdom of) +COA - COZ Cuba +CPA - CPZ Bolivia (Plurinational State of) +CQA - CQZ Portugal +CRA - CRZ Portugal +CSA - CSZ Portugal +CTA - CTZ Portugal +CUA - CUZ Portugal +CVA - CVZ Uruguay (Eastern Republic of) +CWA - CWZ Uruguay (Eastern Republic of) +CXA - CXZ Uruguay (Eastern Republic of) +CYA - CYZ Canada +CZA - CZZ Canada +D2A - D2Z Angola (Republic of) +D3A - D3Z Angola (Republic of) +D4A - D4Z Cabo Verde (Republic of) +D5A - D5Z Liberia (Republic of) +D6A - D6Z Comoros (Union of the) +D7A - D7Z Korea (Republic of) +D8A - D8Z Korea (Republic of) +D9A - D9Z Korea (Republic of) +DAA - DAZ Germany (Federal Republic of) +DBA - DBZ Germany (Federal Republic of) +DCA - DCZ Germany (Federal Republic of) +DDA - DDZ Germany (Federal Republic of) +DEA - DEZ Germany (Federal Republic of) +DFA - DFZ Germany (Federal Republic of) +DGA - DGZ Germany (Federal Republic of) +DHA - DHZ Germany (Federal Republic of) +DIA - DIZ Germany (Federal Republic of) +DJA - DJZ Germany (Federal Republic of) +DKA - DKZ Germany (Federal Republic of) +DLA - DLZ Germany (Federal Republic of) +DMA - DMZ Germany (Federal Republic of) +DNA - DNZ Germany (Federal Republic of) +DOA - DOZ Germany (Federal Republic of) +DPA - DPZ Germany (Federal Republic of) +DQA - DQZ Germany (Federal Republic of) +DRA - DRZ Germany (Federal Republic of) +DSA - DSZ Korea (Republic of) +DTA - DTZ Korea (Republic of) +DUA - DUZ Philippines (Republic of the) +DVA - DVZ Philippines (Republic of the) +DWA - DWZ Philippines (Republic of the) +DXA - DXZ Philippines (Republic of the) +DYA - DYZ Philippines (Republic of the) +DZA - DZZ Philippines (Republic of the) +E2A - E2Z Thailand +E3A - E3Z Eritrea +E4A - E4Z State of Palestine (In accordance with Resolution 99 Rev. Dubai, 2018) +E5A - E5Z New Zealand - Cook Islands +E6A - E6Z New Zealand - Niue +E7A - E7Z Bosnia and Herzegovina +EAA - EAZ Spain +EBA - EBZ Spain +ECA - ECZ Spain +EDA - EDZ Spain +EEA - EEZ Spain +EFA - EFZ Spain +EGA - EGZ Spain +EHA - EHZ Spain +EIA - EIZ Ireland +EJA - EJZ Ireland +EKA - EKZ Armenia (Republic of) +ELA - ELZ Liberia (Republic of) +EMA - EMZ Ukraine +ENA - ENZ Ukraine +EOA - EOZ Ukraine +EPA - EPZ Iran (Islamic Republic of) +EQA - EQZ Iran (Islamic Republic of) +ERA - ERZ Moldova (Republic of) +ESA - ESZ Estonia (Republic of) +ETA - ETZ Ethiopia (Federal Democratic Republic of) +EUA - EUZ Belarus (Republic of) +EVA - EVZ Belarus (Republic of) +EWA - EWZ Belarus (Republic of) +EXA - EXZ Kyrgyz Republic +EYA - EYZ Tajikistan (Republic of) +EZA - EZZ Turkmenistan +FAA - FAZ France +FBA - FBZ France +FCA - FCZ France +FDA - FDZ France +FEA - FEZ France +FFA - FFZ France +FGA - FGZ France +FHA - FHZ France +FIA - FIZ France +FJA - FJZ France +FKA - FKZ France +FLA - FLZ France +FMA - FMZ France +FNA - FNZ France +FOA - FOZ France +FPA - FPZ France +FQA - FQZ France +FRA - FRZ France +FSA - FSZ France +FTA - FTZ France +FUA - FUZ France +FVA - FVZ France +FWA - FWZ France +FXA - FXZ France +FYA - FYZ France +FZA - FZZ France +GAA - GAZ United Kingdom of Great Britain and Northern Ireland +GBA - GBZ United Kingdom of Great Britain and Northern Ireland +GCA - GCZ United Kingdom of Great Britain and Northern Ireland +GDA - GDZ United Kingdom of Great Britain and Northern Ireland +GEA - GEZ United Kingdom of Great Britain and Northern Ireland +GFA - GFZ United Kingdom of Great Britain and Northern Ireland +GGA - GGZ United Kingdom of Great Britain and Northern Ireland +GHA - GHZ United Kingdom of Great Britain and Northern Ireland +GIA - GIZ United Kingdom of Great Britain and Northern Ireland +GJA - GJZ United Kingdom of Great Britain and Northern Ireland +GKA - GKZ United Kingdom of Great Britain and Northern Ireland +GLA - GLZ United Kingdom of Great Britain and Northern Ireland +GMA - GMZ United Kingdom of Great Britain and Northern Ireland +GNA - GNZ United Kingdom of Great Britain and Northern Ireland +GOA - GOZ United Kingdom of Great Britain and Northern Ireland +GPA - GPZ United Kingdom of Great Britain and Northern Ireland +GQA - GQZ United Kingdom of Great Britain and Northern Ireland +GRA - GRZ United Kingdom of Great Britain and Northern Ireland +GSA - GSZ United Kingdom of Great Britain and Northern Ireland +GTA - GTZ United Kingdom of Great Britain and Northern Ireland +GUA - GUZ United Kingdom of Great Britain and Northern Ireland +GVA - GVZ United Kingdom of Great Britain and Northern Ireland +GWA - GWZ United Kingdom of Great Britain and Northern Ireland +GXA - GXZ United Kingdom of Great Britain and Northern Ireland +GYA - GYZ United Kingdom of Great Britain and Northern Ireland +GZA - GZZ United Kingdom of Great Britain and Northern Ireland +H2A - H2Z Cyprus (Republic of) +H3A - H3Z Panama (Republic of) +H4A - H4Z Solomon Islands +H6A - H6Z Nicaragua +H7A - H7Z Nicaragua +H8A - H8Z Panama (Republic of) +H9A - H9Z Panama (Republic of) +HAA - HAZ Hungary +HBA - HBZ Switzerland (Confederation of) +HCA - HCZ Ecuador +HDA - HDZ Ecuador +HEA - HEZ Switzerland (Confederation of) +HFA - HFZ Poland (Republic of) +HGA - HGZ Hungary +HHA - HHZ Haiti (Republic of) +HIA - HIZ Dominican Republic +HJA - HJZ Colombia (Republic of) +HKA - HKZ Colombia (Republic of) +HLA - HLZ Korea (Republic of) +HMA - HMZ Democratic People's Republic of Korea +HNA - HNZ Iraq (Republic of) +HOA - HOZ Panama (Republic of) +HPA - HPZ Panama (Republic of) +HQA - HQZ Honduras (Republic of) +HRA - HRZ Honduras (Republic of) +HSA - HSZ Thailand +HTA - HTZ Nicaragua +HUA - HUZ El Salvador (Republic of) +HVA - HVZ Vatican City State +HWA - HWZ France +HXA - HXZ France +HYA - HYZ France +HZA - HZZ Saudi Arabia (Kingdom of) +IAA - IAZ Italy +IBA - IBZ Italy +ICA - ICZ Italy +IDA - IDZ Italy +IEA - IEZ Italy +IFA - IFZ Italy +IGA - IGZ Italy +IHA - IHZ Italy +IIA - IIZ Italy +IJA - IJZ Italy +IKA - IKZ Italy +ILA - ILZ Italy +IMA - IMZ Italy +INA - INZ Italy +IOA - IOZ Italy +IPA - IPZ Italy +IQA - IQZ Italy +IRA - IRZ Italy +ISA - ISZ Italy +ITA - ITZ Italy +IUA - IUZ Italy +IVA - IVZ Italy +IWA - IWZ Italy +IXA - IXZ Italy +IYA - IYZ Italy +IZA - IZZ Italy +J2A - J2Z Djibouti (Republic of) +J3A - J3Z Grenada +J4A - J4Z Greece +J5A - J5Z Guinea-Bissau (Republic of) +J6A - J6Z Saint Lucia +J7A - J7Z Dominica (Commonwealth of) +J8A - J8Z Saint Vincent and the Grenadines +JAA - JAZ Japan +JBA - JBZ Japan +JCA - JCZ Japan +JDA - JDZ Japan +JEA - JEZ Japan +JFA - JFZ Japan +JGA - JGZ Japan +JHA - JHZ Japan +JIA - JIZ Japan +JJA - JJZ Japan +JKA - JKZ Japan +JLA - JLZ Japan +JMA - JMZ Japan +JNA - JNZ Japan +JOA - JOZ Japan +JPA - JPZ Japan +JQA - JQZ Japan +JRA - JRZ Japan +JSA - JSZ Japan +JTA - JTZ Mongolia +JUA - JUZ Mongolia +JVA - JVZ Mongolia +JWA - JWZ Norway +JXA - JXZ Norway +JYA - JYZ Jordan (Hashemite Kingdom of) +JZA - JZZ Indonesia (Republic of) +KAA - KAZ United States of America +KBA - KBZ United States of America +KCA - KCZ United States of America +KDA - KDZ United States of America +KEA - KEZ United States of America +KFA - KFZ United States of America +KGA - KGZ United States of America +KHA - KHZ United States of America +KIA - KIZ United States of America +KJA - KJZ United States of America +KKA - KKZ United States of America +KLA - KLZ United States of America +KMA - KMZ United States of America +KNA - KNZ United States of America +KOA - KOZ United States of America +KPA - KPZ United States of America +KQA - KQZ United States of America +KRA - KRZ United States of America +KSA - KSZ United States of America +KTA - KTZ United States of America +KUA - KUZ United States of America +KVA - KVZ United States of America +KWA - KWZ United States of America +KXA - KXZ United States of America +KYA - KYZ United States of America +KZA - KZZ United States of America +L2A - L2Z Argentine Republic +L3A - L3Z Argentine Republic +L4A - L4Z Argentine Republic +L5A - L5Z Argentine Republic +L6A - L6Z Argentine Republic +L7A - L7Z Argentine Republic +L8A - L8Z Argentine Republic +L9A - L9Z Argentine Republic +LAA - LAZ Norway +LBA - LBZ Norway +LCA - LCZ Norway +LDA - LDZ Norway +LEA - LEZ Norway +LFA - LFZ Norway +LGA - LGZ Norway +LHA - LHZ Norway +LIA - LIZ Norway +LJA - LJZ Norway +LKA - LKZ Norway +LLA - LLZ Norway +LMA - LMZ Norway +LNA - LNZ Norway +LOA - LOZ Argentine Republic +LPA - LPZ Argentine Republic +LQA - LQZ Argentine Republic +LRA - LRZ Argentine Republic +LSA - LSZ Argentine Republic +LTA - LTZ Argentine Republic +LUA - LUZ Argentine Republic +LVA - LVZ Argentine Republic +LWA - LWZ Argentine Republic +LXA - LXZ Luxembourg +LYA - LYZ Lithuania (Republic of) +LZA - LZZ Bulgaria (Republic of) +MAA - MAZ United Kingdom of Great Britain and Northern Ireland +MBA - MBZ United Kingdom of Great Britain and Northern Ireland +MCA - MCZ United Kingdom of Great Britain and Northern Ireland +MDA - MDZ United Kingdom of Great Britain and Northern Ireland +MEA - MEZ United Kingdom of Great Britain and Northern Ireland +MFA - MFZ United Kingdom of Great Britain and Northern Ireland +MGA - MGZ United Kingdom of Great Britain and Northern Ireland +MHA - MHZ United Kingdom of Great Britain and Northern Ireland +MIA - MIZ United Kingdom of Great Britain and Northern Ireland +MJA - MJZ United Kingdom of Great Britain and Northern Ireland +MKA - MKZ United Kingdom of Great Britain and Northern Ireland +MLA - MLZ United Kingdom of Great Britain and Northern Ireland +MMA - MMZ United Kingdom of Great Britain and Northern Ireland +MNA - MNZ United Kingdom of Great Britain and Northern Ireland +MOA - MOZ United Kingdom of Great Britain and Northern Ireland +MPA - MPZ United Kingdom of Great Britain and Northern Ireland +MQA - MQZ United Kingdom of Great Britain and Northern Ireland +MRA - MRZ United Kingdom of Great Britain and Northern Ireland +MSA - MSZ United Kingdom of Great Britain and Northern Ireland +MTA - MTZ United Kingdom of Great Britain and Northern Ireland +MUA - MUZ United Kingdom of Great Britain and Northern Ireland +MVA - MVZ United Kingdom of Great Britain and Northern Ireland +MWA - MWZ United Kingdom of Great Britain and Northern Ireland +MXA - MXZ United Kingdom of Great Britain and Northern Ireland +MYA - MYZ United Kingdom of Great Britain and Northern Ireland +MZA - MZZ United Kingdom of Great Britain and Northern Ireland +NAA - NAZ United States of America +NBA - NBZ United States of America +NCA - NCZ United States of America +NDA - NDZ United States of America +NEA - NEZ United States of America +NFA - NFZ United States of America +NGA - NGZ United States of America +NHA - NHZ United States of America +NIA - NIZ United States of America +NJA - NJZ United States of America +NKA - NKZ United States of America +NLA - NLZ United States of America +NMA - NMZ United States of America +NNA - NNZ United States of America +NOA - NOZ United States of America +NPA - NPZ United States of America +NQA - NQZ United States of America +NRA - NRZ United States of America +NSA - NSZ United States of America +NTA - NTZ United States of America +NUA - NUZ United States of America +NVA - NVZ United States of America +NWA - NWZ United States of America +NXA - NXZ United States of America +NYA - NYZ United States of America +NZA - NZZ United States of America +OAA - OAZ Peru +OBA - OBZ Peru +OCA - OCZ Peru +ODA - ODZ Lebanon +OEA - OEZ Austria +OFA - OFZ Finland +OGA - OGZ Finland +OHA - OHZ Finland +OIA - OIZ Finland +OJA - OJZ Finland +OKA - OKZ Czech Republic +OLA - OLZ Czech Republic +OMA - OMZ Slovak Republic +ONA - ONZ Belgium +OOA - OOZ Belgium +OPA - OPZ Belgium +OQA - OQZ Belgium +ORA - ORZ Belgium +OSA - OSZ Belgium +OTA - OTZ Belgium +OUA - OUZ Denmark +OVA - OVZ Denmark +OWA - OWZ Denmark +OXA - OXZ Denmark +OYA - OYZ Denmark +OZA - OZZ Denmark +P2A - P2Z Papua New Guinea +P3A - P3Z Cyprus (Republic of) +P4A - P4Z Netherlands (Kingdom of the) - Aruba +P5A - P5Z Democratic People's Republic of Korea +P6A - P6Z Democratic People's Republic of Korea +P7A - P7Z Democratic People's Republic of Korea +P8A - P8Z Democratic People's Republic of Korea +P9A - P9Z Democratic People's Republic of Korea +PAA - PAZ Netherlands (Kingdom of the) +PBA - PBZ Netherlands (Kingdom of the) +PCA - PCZ Netherlands (Kingdom of the) +PDA - PDZ Netherlands (Kingdom of the) +PEA - PEZ Netherlands (Kingdom of the) +PFA - PFZ Netherlands (Kingdom of the) +PGA - PGZ Netherlands (Kingdom of the) +PHA - PHZ Netherlands (Kingdom of the) +PIA - PIZ Netherlands (Kingdom of the) +PJA - PJZ Netherlands (Kingdom of the) - Bonaire, Sint Eustatius and Saba +PJA - PJZ Netherlands (Kingdom of the) - Curaçao +PJA - PJZ Netherlands (Kingdom of the) - Sint Maarten (Dutch part) +PKA - PKZ Indonesia (Republic of) +PLA - PLZ Indonesia (Republic of) +PMA - PMZ Indonesia (Republic of) +PNA - PNZ Indonesia (Republic of) +POA - POZ Indonesia (Republic of) +PPA - PPZ Brazil (Federative Republic of) +PQA - PQZ Brazil (Federative Republic of) +PRA - PRZ Brazil (Federative Republic of) +PSA - PSZ Brazil (Federative Republic of) +PTA - PTZ Brazil (Federative Republic of) +PUA - PUZ Brazil (Federative Republic of) +PVA - PVZ Brazil (Federative Republic of) +PWA - PWZ Brazil (Federative Republic of) +PXA - PXZ Brazil (Federative Republic of) +PYA - PYZ Brazil (Federative Republic of) +PZA - PZZ Suriname (Republic of) +RAA - RAZ Russian Federation +RBA - RBZ Russian Federation +RCA - RCZ Russian Federation +RDA - RDZ Russian Federation +REA - REZ Russian Federation +RFA - RFZ Russian Federation +RGA - RGZ Russian Federation +RHA - RHZ Russian Federation +RIA - RIZ Russian Federation +RJA - RJZ Russian Federation +RKA - RKZ Russian Federation +RLA - RLZ Russian Federation +RMA - RMZ Russian Federation +RNA - RNZ Russian Federation +ROA - ROZ Russian Federation +RPA - RPZ Russian Federation +RQA - RQZ Russian Federation +RRA - RRZ Russian Federation +RSA - RSZ Russian Federation +RTA - RTZ Russian Federation +RUA - RUZ Russian Federation +RVA - RVZ Russian Federation +RWA - RWZ Russian Federation +RXA - RXZ Russian Federation +RYA - RYZ Russian Federation +RZA - RZZ Russian Federation +S2A - S2Z Bangladesh (People's Republic of) +S3A - S3Z Bangladesh (People's Republic of) +S5A - S5Z Slovenia (Republic of) +S6A - S6Z Singapore (Republic of) +S7A - S7Z Seychelles (Republic of) +S8A - S8Z South Africa (Republic of) +S9A - S9Z Sao Tome and Principe (Democratic Republic of) +SAA - SAZ Sweden +SBA - SBZ Sweden +SCA - SCZ Sweden +SDA - SDZ Sweden +SEA - SEZ Sweden +SFA - SFZ Sweden +SGA - SGZ Sweden +SHA - SHZ Sweden +SIA - SIZ Sweden +SJA - SJZ Sweden +SKA - SKZ Sweden +SLA - SLZ Sweden +SMA - SMZ Sweden +SNA - SNZ Poland (Republic of) +SOA - SOZ Poland (Republic of) +SPA - SPZ Poland (Republic of) +SQA - SQZ Poland (Republic of) +SRA - SRZ Poland (Republic of) +SSA - SSM Egypt (Arab Republic of) +SSN - SSZ Sudan (Republic of the) +STA - STZ Sudan (Republic of the) +SUA - SUZ Egypt (Arab Republic of) +SVA - SVZ Greece +SWA - SWZ Greece +SXA - SXZ Greece +SYA - SYZ Greece +SZA - SZZ Greece +T2A - T2Z Tuvalu +T3A - T3Z Kiribati (Republic of) +T4A - T4Z Cuba +T5A - T5Z Somalia (Federal Republic of) +T6A - T6Z Afghanistan +T7A - T7Z San Marino (Republic of) +T8A - T8Z Palau (Republic of) +TAA - TAZ Turkey +TBA - TBZ Turkey +TCA - TCZ Turkey +TDA - TDZ Guatemala (Republic of) +TEA - TEZ Costa Rica +TFA - TFZ Iceland +TGA - TGZ Guatemala (Republic of) +THA - THZ France +TIA - TIZ Costa Rica +TJA - TJZ Cameroon (Republic of) +TKA - TKZ France +TLA - TLZ Central African Republic +TMA - TMZ France +TNA - TNZ Congo (Republic of the) +TOA - TOZ France +TPA - TPZ France +TQA - TQZ France +TRA - TRZ Gabonese Republic +TSA - TSZ Tunisia +TTA - TTZ Chad (Republic of) +TUA - TUZ Côte d'Ivoire (Republic of) +TVA - TVZ France +TWA - TWZ France +TXA - TXZ France +TYA - TYZ Benin (Republic of) +TZA - TZZ Mali (Republic of) +UAA - UAZ Russian Federation +UBA - UBZ Russian Federation +UCA - UCZ Russian Federation +UDA - UDZ Russian Federation +UEA - UEZ Russian Federation +UFA - UFZ Russian Federation +UGA - UGZ Russian Federation +UHA - UHZ Russian Federation +UIA - UIZ Russian Federation +UJA - UJZ Uzbekistan (Republic of) +UKA - UKZ Uzbekistan (Republic of) +ULA - ULZ Uzbekistan (Republic of) +UMA - UMZ Uzbekistan (Republic of) +UNA - UNZ Kazakhstan (Republic of) +UOA - UOZ Kazakhstan (Republic of) +UPA - UPZ Kazakhstan (Republic of) +UQA - UQZ Kazakhstan (Republic of) +URA - URZ Ukraine +USA - USZ Ukraine +UTA - UTZ Ukraine +UUA - UUZ Ukraine +UVA - UVZ Ukraine +UWA - UWZ Ukraine +UXA - UXZ Ukraine +UYA - UYZ Ukraine +UZA - UZZ Ukraine +V2A - V2Z Antigua and Barbuda +V3A - V3Z Belize +V4A - V4Z Saint Kitts and Nevis (Federation of) +V5A - V5Z Namibia (Republic of) +V6A - V6Z Micronesia (Federated States of) +V7A - V7Z Marshall Islands (Republic of the) +V8A - V8Z Brunei Darussalam +VAA - VAZ Canada +VBA - VBZ Canada +VCA - VCZ Canada +VDA - VDZ Canada +VEA - VEZ Canada +VFA - VFZ Canada +VGA - VGZ Canada +VHA - VHZ Australia +VIA - VIZ Australia +VJA - VJZ Australia +VKA - VKZ Australia +VLA - VLZ Australia +VMA - VMZ Australia +VNA - VNZ Australia +VOA - VOZ Canada +VPA - VPZ United Kingdom of Great Britain and Northern Ireland +VQA - VQZ United Kingdom of Great Britain and Northern Ireland +VRA - VRZ China (People's Republic of) - Hong Kong +VSA - VSZ United Kingdom of Great Britain and Northern Ireland +VTA - VTZ India (Republic of) +VUA - VUZ India (Republic of) +VVA - VVZ India (Republic of) +VWA - VWZ India (Republic of) +VXA - VXZ Canada +VYA - VYZ Canada +VZA - VZZ Australia +WAA - WAZ United States of America +WBA - WBZ United States of America +WCA - WCZ United States of America +WDA - WDZ United States of America +WEA - WEZ United States of America +WFA - WFZ United States of America +WGA - WGZ United States of America +WHA - WHZ United States of America +WIA - WIZ United States of America +WJA - WJZ United States of America +WKA - WKZ United States of America +WLA - WLZ United States of America +WMA - WMZ United States of America +WNA - WNZ United States of America +WOA - WOZ United States of America +WPA - WPZ United States of America +WQA - WQZ United States of America +WRA - WRZ United States of America +WSA - WSZ United States of America +WTA - WTZ United States of America +WUA - WUZ United States of America +WVA - WVZ United States of America +WWA - WWZ United States of America +WXA - WXZ United States of America +WYA - WYZ United States of America +WZA - WZZ United States of America +XAA - XAZ Mexico +XBA - XBZ Mexico +XCA - XCZ Mexico +XDA - XDZ Mexico +XEA - XEZ Mexico +XFA - XFZ Mexico +XGA - XGZ Mexico +XHA - XHZ Mexico +XIA - XIZ Mexico +XJA - XJZ Canada +XKA - XKZ Canada +XLA - XLZ Canada +XMA - XMZ Canada +XNA - XNZ Canada +XOA - XOZ Canada +XPA - XPZ Denmark +XQA - XQZ Chile +XRA - XRZ Chile +XSA - XSZ China (People's Republic of) +XTA - XTZ Burkina Faso +XUA - XUZ Cambodia (Kingdom of) +XVA - XVZ Viet Nam (Socialist Republic of) +XWA - XWZ Lao People's Democratic Republic +XXA - XXZ China (People's Republic of) - Macao +XYA - XYZ Myanmar (Union of) +XZA - XZZ Myanmar (Union of) +Y2A - Y2Z Germany (Federal Republic of) +Y3A - Y3Z Germany (Federal Republic of) +Y4A - Y4Z Germany (Federal Republic of) +Y5A - Y5Z Germany (Federal Republic of) +Y6A - Y6Z Germany (Federal Republic of) +Y7A - Y7Z Germany (Federal Republic of) +Y8A - Y8Z Germany (Federal Republic of) +Y9A - Y9Z Germany (Federal Republic of) +YAA - YAZ Afghanistan +YBA - YBZ Indonesia (Republic of) +YCA - YCZ Indonesia (Republic of) +YDA - YDZ Indonesia (Republic of) +YEA - YEZ Indonesia (Republic of) +YFA - YFZ Indonesia (Republic of) +YGA - YGZ Indonesia (Republic of) +YHA - YHZ Indonesia (Republic of) +YIA - YIZ Iraq (Republic of) +YJA - YJZ Vanuatu (Republic of) +YKA - YKZ Syrian Arab Republic +YLA - YLZ Latvia (Republic of) +YMA - YMZ Turkey +YNA - YNZ Nicaragua +YOA - YOZ Romania +YPA - YPZ Romania +YQA - YQZ Romania +YRA - YRZ Romania +YSA - YSZ El Salvador (Republic of) +YTA - YTZ Serbia (Republic of) +YUA - YUZ Serbia (Republic of) +YVA - YVZ Venezuela (Bolivarian Republic of) +YWA - YWZ Venezuela (Bolivarian Republic of) +YXA - YXZ Venezuela (Bolivarian Republic of) +YYA - YYZ Venezuela (Bolivarian Republic of) +Z2A - Z2Z Zimbabwe (Republic of) +Z3A - Z3Z North Macedonia (Republic of) +Z8A - Z8Z South Sudan (Republic of) +ZAA - ZAZ Albania (Republic of) +ZBA - ZBZ United Kingdom of Great Britain and Northern Ireland +ZCA - ZCZ United Kingdom of Great Britain and Northern Ireland +ZDA - ZDZ United Kingdom of Great Britain and Northern Ireland +ZEA - ZEZ United Kingdom of Great Britain and Northern Ireland +ZFA - ZFZ United Kingdom of Great Britain and Northern Ireland +ZGA - ZGZ United Kingdom of Great Britain and Northern Ireland +ZHA - ZHZ United Kingdom of Great Britain and Northern Ireland +ZIA - ZIZ United Kingdom of Great Britain and Northern Ireland +ZJA - ZJZ United Kingdom of Great Britain and Northern Ireland +ZKA - ZKZ New Zealand +ZLA - ZLZ New Zealand +ZMA - ZMZ New Zealand +ZNA - ZNZ United Kingdom of Great Britain and Northern Ireland +ZOA - ZOZ United Kingdom of Great Britain and Northern Ireland +ZPA - ZPZ Paraguay (Republic of) +ZQA - ZQZ United Kingdom of Great Britain and Northern Ireland +ZRA - ZRZ South Africa (Republic of) +ZSA - ZSZ South Africa (Republic of) +ZTA - ZTZ South Africa (Republic of) +ZUA - ZUZ South Africa (Republic of) +ZVA - ZVZ Brazil (Federative Republic of) +ZWA - ZWZ Brazil (Federative Republic of) +ZXA - ZXZ Brazil (Federative Republic of) +ZYA - ZYZ Brazil (Federative Republic of) +ZZA - ZZZ Brazil (Federative Republic of) diff --git a/itu_prefixes/preprocess.py b/itu_prefixes/preprocess.py new file mode 100755 index 0000000..fd394a3 --- /dev/null +++ b/itu_prefixes/preprocess.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 + +import sys + +filename_in = sys.argv[1] + +# maps country names to a list of prefixes +countrymap = {} + +# load all countries +with open(filename_in, 'r') as infile: + first_line = True + for line in infile: + if first_line: + first_line = False + continue + + parts = line.strip().split("\t") + + print(len(parts)) + + if len(parts) != 2: + continue + + if parts[1] not in countrymap: + countrymap[parts[1]] = [] + + countrymap[parts[1]].append(parts[0]) + + print(f"{parts[1]} => {parts[0]}") + +for country in countrymap.keys(): + raw_prefixes = countrymap[country] + + ranges = [] + for prefixrange in raw_prefixes: + parts = prefixrange.split(" - ") + ranges += [tuple(parts)] + + ranges.sort() + + minimized_prefixes_1 = [] + + # eliminate all ranges that completely cover A-Z + for rng in ranges: + if rng[0][-1] == 'A' and rng[1][-1] == 'Z': + minimized_prefixes_1.append(rng[0][:2]) + else: + minimized_prefixes_1.append(rng) + + # consolidate higher-level ranges + minimized_prefixes = [] + + start = 0 + while start < len(minimized_prefixes_1): + first_prefix = minimized_prefixes_1[start] + + if type(first_prefix) == tuple: + minimized_prefixes.append(first_prefix) + start += 1 + else: + reference = first_prefix[0] + + end = start + while end < len(minimized_prefixes_1) and \ + minimized_prefixes_1[end][0] == reference: + end += 1 + + # end now marks the first prefix that does not match the reference + last_prefix = minimized_prefixes_1[end-1] + + if first_prefix == last_prefix: + minimized_prefixes.append(first_prefix) + elif first_prefix[-1] == 'A' and last_prefix[-1] == 'Z': + minimized_prefixes.append(first_prefix[:-1]) + else: + minimized_prefixes.append((first_prefix, last_prefix)) + + start = end + + countrymap[country] = minimized_prefixes + + print(f"{country:30s} => {minimized_prefixes}") + +with open("country2call.tsv", "w") as country2callfile: + for country in sorted(countrymap.keys()): + prefixes = countrymap[country] + + formatted_list = [] + for p in prefixes: + if type(p) == tuple: + formatted_list.append("-".join(p)) + else: + formatted_list.append(p) + + country2callfile.write(country + "\t" + ", ".join(formatted_list) + "\n") + +with open("call2country.tsv", "w") as call2countryfile: + # reverse the dict direction + call2country = {} + + for k, v in countrymap.items(): + for p in v: + if type(p) == tuple: + newk = "-".join(p) + else: + newk = p + + call2country[newk] = k + + for k in sorted(call2country.keys()): + call2countryfile.write(k + "\t" + call2country[k] + "\n")