Skip to content

mdymalla/ISO3166-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ISO3166-Library

These codes are the standard for defining countries, dependent territories, special areas of geographical interest, and their principal subdivisions.

Data

contains all ICU supported countries including iso3166-1 & iso3166-2 codes in addition to their supported translations.

Structure

3166-1

The 3166-1 directory contains both ISO3166-1 official country codes and meta data as well as supported translations separated by locale.

'data/3166-1/meta.json':

"AU": {
    "alpha-2": "AU",
    "alpha-3": "AUD",
    "numeric": "036"
}

'data/3166-1/ja.json':

{
    "AU": "オーストラリア"
}

3166-2

The 3166-2 directory contains both ISO3166-2 official Sub-division codes and meta data as well as supported translations both separated by alpha-2 country code and locale. Since it is more common to require the sub-divisions for a specific country this structure avoids the loading of irrelevant data.

'data/3166-2/GB/meta.json':

{
    "GB-SCT": {
        "code": "GB-SCT",
        "type": "Country"
    },
    "GB-NLK": {
        "code": "GB-NLK",
        "type": "Council area",
        "parent": "SCT"
    }
}

'data/3166-2/GB/ja.json':

{
    "GB-SCT": "スコットランド"
}

Usage

The data itself is intended to be language agnostic to allow for implementations across numerous languages.

Example implementations can be found below:

NPM

https://www.npmjs.com/package/iso3166-library

PHP (packagist)

https://packagist.org/packages/mjdymalla/iso3166-php

Data Sources

Symfony/Intl:

https://github.com/symfony/symfony

Debain/iso-codes

https://salsa.debian.org/iso-codes-team/iso-codes

About

Library for ISO 3166-1 & 3166-2 data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published