forked from adamlc/address-format
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
255 changed files
with
673 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Composer Artifacts | ||
[Vv]endor/ | ||
composer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
|
||
before_script: composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name" : "Adamlc/AddressFormat", | ||
"type" : "library", | ||
"description" : "A PHP library to parse street addresses to localized formats", | ||
"homepage" : "https://github.com/adamlc/AddressFormat", | ||
"license" : "MIT", | ||
|
||
"require" : { | ||
"php" : ">=5.3.0" | ||
}, | ||
|
||
"autoload" : { | ||
"psr-0" : { | ||
"Adamlc\\AddressFormat": "src/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
> | ||
<testsuites> | ||
<testsuite name="AddressFormat Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
5 changes: 5 additions & 0 deletions
5
src/Adamlc/AddressFormat/Exceptions/AttributeInvalidException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace Adamlc\AddressFormat\Exceptions; | ||
|
||
class AttributeInvalidException extends \RuntimeException {} |
5 changes: 5 additions & 0 deletions
5
src/Adamlc/AddressFormat/Exceptions/LocaleNotSupportedException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace Adamlc\AddressFormat\Exceptions; | ||
|
||
class LocaleNotSupportedException extends \RuntimeException {} |
5 changes: 5 additions & 0 deletions
5
src/Adamlc/AddressFormat/Exceptions/LocaleParseErrorException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace Adamlc\AddressFormat\Exceptions; | ||
|
||
class LocaleParseErrorException extends \RuntimeException {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<?php | ||
|
||
namespace Adamlc\AddressFormat; | ||
|
||
use Adamlc\AddressFormat\Exceptions\AttributeInvalidException; | ||
use Adamlc\AddressFormat\Exceptions\LocaleNotSupportedException; | ||
use Adamlc\AddressFormat\Exceptions\LocaleParseErrorException; | ||
|
||
/** | ||
* Use this call to format a street address according to different locales | ||
*/ | ||
class Format { | ||
|
||
private $locale; | ||
|
||
/** | ||
* This map specifies the content on how to format the address | ||
* See this URL for origin reference - https://code.google.com/p/libaddressinput/source/browse/trunk/src/com/android/i18n/addressinput/AddressField.java?r=111 | ||
* | ||
* @var mixed | ||
* @access private | ||
*/ | ||
private $address_map = array( | ||
'S' => 'ADMIN_AREA', //state | ||
'C' => 'LOCALITY', //city | ||
'N' => 'RECIPIENT', //name | ||
'O' => 'ORGANIZATION', //organization | ||
'1' => 'ADDRESS_LINE_1', //street1 | ||
'2' => 'ADDRESS_LINE_2', //street1 | ||
'D' => 'DEPENDENT_LOCALITY', | ||
'Z' => 'POSTAL_CODE', | ||
'X' => 'SORTING_CODE', | ||
'A' => 'STREET_ADDRESS', //Deprecated | ||
'R' => 'COUNTRY' | ||
); | ||
|
||
/** | ||
* The input map will hold all the information we put in to the class | ||
* | ||
* @var mixed | ||
* @access private | ||
*/ | ||
private $input_map = array( | ||
'ADMIN_AREA' => '', //state | ||
'LOCALITY' => '', //city | ||
'RECIPIENT' => '', //name | ||
'ORGANIZATION' => '', //organization | ||
'ADDRESS_LINE_1' => '', //street1 | ||
'ADDRESS_LINE_2' => '', //street1 | ||
'DEPENDENT_LOCALITY' => '', | ||
'POSTAL_CODE' => '', | ||
'SORTING_CODE' => '', | ||
'STREET_ADDRESS' => '', //Deprecated | ||
'COUNTRY' => '' | ||
); | ||
|
||
/** | ||
* setLocale will set the locale. This is currently a 2 digit ISO country code | ||
* | ||
* @access public | ||
* @param mixed $locale | ||
* @return void | ||
*/ | ||
public function setLocale($locale) { | ||
//Check if we have information for this locale | ||
$file = __DIR__ . '/i18n/' . $locale . '.json'; | ||
if (file_exists($file)) { | ||
//Read the locale information from the file | ||
$meta = json_decode(file_get_contents($file), true); | ||
if(is_array($meta)){ | ||
$this->locale = $meta; | ||
|
||
return true; | ||
} | ||
else { | ||
throw new LocaleParseErrorException('Locale "' . $locale . '" could not be parsed correctly'); | ||
} | ||
} | ||
else { | ||
throw new LocaleNotSupportedException('Locale not supported by this library'); | ||
} | ||
} | ||
|
||
/** | ||
* Return the formatted address, using the locale set. Optionally return HTML or plain text | ||
* | ||
* @access public | ||
* @param bool $html (default: false) | ||
* @return void | ||
*/ | ||
public function formatAddress($html = false) { | ||
//Check if this locale has a fmt field | ||
if(isset($this->locale['fmt'])){ | ||
$address_format = $this->locale['fmt']; | ||
|
||
//Loop through each address part and process it! | ||
$formatted_address = $address_format; | ||
|
||
//Replace the street values | ||
foreach($this->address_map as $key => $value){ | ||
$formatted_address = str_replace('%' . $key, $this->input_map[$value], $formatted_address); | ||
} | ||
|
||
//Replace new lines! | ||
if($html){ | ||
$formatted_address = str_replace('%n', "\n" . '<br>', $formatted_address); | ||
} | ||
else { | ||
$formatted_address = str_replace('%n', "\n", $formatted_address); | ||
} | ||
|
||
return $formatted_address; | ||
} | ||
else { | ||
throw new LocaleNotSupportedException('Locale not supported by this library'); | ||
} | ||
} | ||
|
||
/** | ||
* Set an address attribute. | ||
* | ||
* @access public | ||
* @param mixed $attribute | ||
* @param mixed $value | ||
* @return string $value | ||
*/ | ||
public function setAttribute($attribute, $value) { | ||
//Check this attribute is support | ||
if(isset($this->input_map[$attribute])){ | ||
$this->input_map[$attribute] = $value; | ||
|
||
return $value; | ||
} | ||
else { | ||
throw new AttributeInvalidException('Attribute not supported by this library'); | ||
} | ||
} | ||
|
||
/** | ||
* Get an address attribute. | ||
* | ||
* @access public | ||
* @param mixed $attribute | ||
* @return void | ||
*/ | ||
public function getAttribute($attribute) { | ||
//Check this attribute is support | ||
if(isset($this->input_map[$attribute])){ | ||
return $this->input_map[$attribute]; | ||
} | ||
else { | ||
throw new AttributeInvalidException('Attribute not supported by this library'); | ||
} | ||
} | ||
|
||
/** | ||
* Clear all attributes. | ||
* | ||
* @access public | ||
* @return void | ||
*/ | ||
public function clearAttributes() { | ||
foreach($this->input_map as $key => $value){ | ||
$this->input_map[$key] = ''; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Adamlc\AddressFormat; | ||
|
||
/** | ||
* The class used to update the data we fetch from the Google API. You shouldn't need to run this. | ||
*/ | ||
class PopulateLocales { | ||
|
||
/** | ||
* Locale Data URL - this is used to parse the list of available countries | ||
* | ||
* (default value: 'http://i18napis.appspot.com/address/data') | ||
* | ||
* @var string | ||
* @access private | ||
*/ | ||
private $locale_data_url = 'http://i18napis.appspot.com/address/data'; | ||
|
||
/** | ||
* Function to fetch data from Google API and populate local files. | ||
* | ||
* @access public | ||
* @return void | ||
*/ | ||
public function fetchData() { | ||
$locales = json_decode(file_get_contents($this->locale_data_url)); | ||
|
||
if(isset($locales->countries)){ | ||
//For some reason the countries are seperated by a tilde | ||
$countries = explode('~', $locales->countries); | ||
|
||
$data_dir = __DIR__ . '/i18n'; | ||
|
||
//Loop countries and grab the corrosponding json data | ||
foreach($countries as $country){ | ||
$file = $data_dir . '/' . $country . '.json'; | ||
|
||
file_put_contents($file, file_get_contents($this->locale_data_url . '/' . $country)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"key": "AC", "zipex": "ASCN 1ZZ", "id": "data/AC", "zip": "ASCN 1ZZ", "name": "ASCENSION ISLAND"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lang": "ca", "upper": "S", "sub_zipexs": "AD500~AD100~AD200~AD700~AD400~AD300~AD600", "zipex": "AD100,AD501,AD700", "name": "ANDORRA", "zip": "AD[1-7]0\\d", "require": "AS", "fmt": "%N%n%O%n%A%n%Z %S", "state_name_type": "parish", "languages": "ca", "sub_keys": "ANDORRA LA VELLA~CANILLO~ENCAMP~ESCALDES ENGORDANY~LAMASSANA~ORDINO~SANT JULIA DE LORIA", "key": "AD", "sub_isoids": "07~02~03~08~04~05~06", "posturl": "http://www.correos.es/comun/CodigosPostales/1010_s-CodPostal.asp?Provincia=", "id": "data/AD", "sub_names": "Andorra la Vella~Canillo~Encamp~Escaldes Engordany~Lamassana~Ordino~Sant Julia de Loria", "sub_zips": "AD50[01]~AD10[01]~AD20[01]~AD70[01]~AD40[01]~AD30[01]~AD60[01]"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"fmt": "%N%n%O%n%A%n%C", "require": "AC", "id": "data/AE", "key": "AE", "name": "UNITED ARAB EMIRATES"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "1001,2601,3801", "posturl": "http://afghanpost.gov.af/Postal%20Code/", "zip": "\\d{4}", "key": "AF", "id": "data/AF", "name": "AFGHANISTAN"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"require": "A", "id": "data/AG", "key": "AG", "name": "ANTIGUA AND BARBUDA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"key": "AI", "zipex": "2640", "id": "data/AI", "zip": "2640", "name": "ANGUILLA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"key": "AL", "zipex": "1001,1017,3501", "id": "data/AL", "zip": "\\d{4}", "name": "ALBANIA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lang": "hy", "sub_zipexs": "0201,0514~0601,0823~0901,1149~1201,1626~0000,0099~1701,2117~2201,2506~2601,3126~3201,3519~3601,3810~3901,4216", "zipex": "375010,0002,0010", "name": "ARMENIA", "zip": "(37)?\\d{4}", "fmt": "%N%n%O%n%A%n%Z%n%C%n%S", "languages": "hy", "lfmt": "%N%n%O%n%A%n%Z%n%C%n%S", "sub_lnames": "Aragatsotn~Ararat~Armavir~Gegharkunik~Yerevan~Lori~Kotayk~Shirak~Syunik~Vayots Dzor~Tavush", "sub_keys": "Արագածոտն~Արարատ~Արմավիր~Գեղարքունիք~Երևան~Լոռի~Կոտայք~Շիրակ~Սյունիք~Վայոց ձոր~Տավուշ", "key": "AM", "sub_isoids": "AG~AR~AV~GR~ER~LO~KT~SH~SU~VD~TV", "id": "data/AM", "sub_zips": "0[2-5]~0[6-8]~09|1[01]~1[2-6]~00~1[7-9]|2[01]~2[2-5]~2[6-9]|3[01]~3[2-5]~3[6-8]~39|4[0-2]"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/AN", "key": "AN", "name": "NETHERLANDS ANTILLES"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/AO", "key": "AO", "name": "ANGOLA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/AQ", "key": "AQ", "name": "ANTARCTICA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lang": "es", "upper": "ACZ", "zipex": "C1070AAM,C1000WAM,B1000TBU,X5187XAB", "name": "ARGENTINA", "zip": "([A-HJ-NP-Z])?\\d{4}([A-Z]{3})?", "fmt": "%N%n%O%n%A%n%Z %C%n%S", "state_name_type": "state", "languages": "es", "sub_keys": "Buenos Aires~Capital Federal~Catamarca~Chaco~Chubut~Córdoba~Corrientes~Entre Ríos~Formosa~Jujuy~La Pampa~La Rioja~Mendoza~Misiones~Neuquén~Río Negro~Salta~San Juan~San Luis~Santa Cruz~Santa Fe~Santiago del Estero~Tierra del Fuego~Tucumán", "key": "AR", "sub_isoids": "B~C~K~H~U~X~W~E~P~Y~L~F~M~N~Q~R~A~J~D~Z~S~G~V~T", "posturl": "http://www.correoargentino.com.ar/cpa", "id": "data/AR", "sub_names": "Buenos Aires~Capital Federal~Catamarca~Chaco~Chubut~Córdoba~Corrientes~Entre Ríos~Formosa~Jujuy~La Pampa~La Rioja~Mendoza~Misiones~Neuquén~Río Negro~Salta~San Juan~San Luis~Santa Cruz~Santa Fe~Santiago del Estero~Tierra del Fuego~Tucumán", "sub_zips": "B?[1-36-8]~C?1~K?[45]~H?3~U?[89]~X?[235-8]~W?3~E?[1-3]~P?[37]~Y?4~L?[3568]~F?5~M?[56]~N?3~Q?[38]~R?[89]~A?[34]~J?5~D?[4-6]~Z?[89]~S?[2368]~G?[2-5]~V?9~T?[45]"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"upper": "ACNOS", "zipex": "96799", "name": "AMERICAN SAMOA", "zip": "96799", "zip_name_type": "zip", "require": "ACSZ", "fmt": "%N%n%O%n%A%n%C %S %Z", "state_name_type": "state", "key": "AS", "posturl": "http://zip4.usps.com/zip4/welcome.jsp", "id": "data/AS"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "1010,3741", "name": "AUSTRIA", "zip": "\\d{4}", "require": "ACZ", "id": "data/AT", "key": "AT", "posturl": "http://www.post.at/post_subsite_postleitzahlfinder.php", "fmt": "%O%n%N%n%A%n%Z %C"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lang": "en", "upper": "CS", "sub_zipexs": "0200,0299:2540:2600,2618:2620:2900,2999~1000,1999:2000,2999:3500:3585:3586:3644:3707~0800,0999~4000,4999:9000,9999~5000,5999:0872~7000,7999~3000,3999:8000,8999~6000,6999:0872", "zipex": "2060,3171,6430,4000,4006,3001", "name": "AUSTRALIA", "zip": "\\d{4}", "require": "ACSZ", "fmt": "%O%n%N%n%A%n%C %S %Z", "state_name_type": "state", "languages": "en", "sub_keys": "ACT~NSW~NT~QLD~SA~TAS~VIC~WA", "key": "AU", "posturl": "http://www1.auspost.com.au/postcodes/", "id": "data/AU", "sub_names": "Australian Capital Territory~New South Wales~Northern Territory~Queensland~South Australia~Tasmania~Victoria~Western Australia", "sub_zips": "29|2540|260|261[0-8]|02|2620~1|2[0-57-8]|26[2-9]|261[189]|3500|3585|3586|3644|3707~0[89]~[49]~5|0872~7~[38]~6|0872"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/AW", "key": "AW", "name": "ARUBA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"postprefix": "AX-", "zipex": "22150,22550,22240,22710,22270,22730,22430", "name": "FINLAND", "zip": "22\\d{3}", "require": "ACZ", "fmt": "%O%n%N%n%A%nAX-%Z %C%nÅLAND", "key": "AX", "posturl": "http://www.posten.ax/department.con?iPage=123", "id": "data/AX"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"postprefix": "AZ ", "zipex": "1000", "name": "AZERBAIJAN", "zip": "\\d{4}", "fmt": "%N%n%O%n%A%nAZ %Z %C", "key": "AZ", "id": "data/AZ"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "71000", "posturl": "http://www.post.ba/postanski_brojevi.php", "zip": "\\d{5}", "fmt": "%N%n%O%n%A%n%Z %C", "key": "BA", "id": "data/BA", "name": "BOSNIA AND HERZEGOVINA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "BB23026,BB22025", "posturl": "http://barbadospostal.com/zipcodes.html", "zip": "(BB\\d{5})?", "state_name_type": "parish", "key": "BB", "id": "data/BB", "name": "BARBADOS"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "1340,1000", "posturl": "http://www.bangladeshpost.gov.bd/PostCode.asp", "zip": "\\d{4}", "fmt": "%N%n%O%n%A%n%C - %Z", "key": "BD", "id": "data/BD", "name": "BANGLADESH"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "4000,1000", "name": "BELGIUM", "zip": "\\d{4}", "require": "ACZ", "id": "data/BE", "key": "BE", "posturl": "http://www.post.be/site/nl/residential/customerservice/search/postal_codes.html", "fmt": "%O%n%N%n%A%n%Z %C"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"fmt": "%N%n%O%n%A%n%C %X", "id": "data/BF", "key": "BF", "name": "BURKINA FASO"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "1000,1700", "posturl": "http://www.bgpost.bg/?cid=5", "zip": "\\d{4}", "fmt": "%N%n%O%n%A%n%Z %C", "key": "BG", "id": "data/BG", "name": "BULGARIA (REP.)"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "317", "name": "BAHRAIN", "zip": "((\\d|1[0-2])\\d{2})?", "fmt": "%N%n%O%n%A%n%C %Z", "key": "BH", "id": "data/BH"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/BI", "key": "BI", "name": "BURUNDI"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"upper": "AC", "id": "data/BJ", "key": "BJ", "name": "BENIN"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"upper": "ACX", "zipex": "97100", "name": "SAINT BARTHELEMY", "zip": "9[78][01]\\d{2}", "require": "ACZ", "fmt": "%O%n%N%n%A%n%Z %C %X", "key": "BL", "posturl": "http://www.laposte.fr/sna/rubrique.php3?id_rubrique=59", "id": "data/BL"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "FL 07,HM GX,HM 12", "posturl": "http://www.landvaluation.bm/", "zip": "[A-Z]{2}[ ]?[A-Z0-9]{2}", "fmt": "%N%n%O%n%A%n%C %Z", "key": "BM", "id": "data/BM", "name": "BERMUDA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "BT2328,KA1131,BA1511", "posturl": "http://www.post.gov.bn/index.php/extensions/postcode-guide", "zip": "[A-Z]{2}[ ]?\\d{4}", "fmt": "%N%n%O%n%A%n%C %Z", "key": "BN", "id": "data/BN", "name": "BRUNEI DARUSSALAM"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"upper": "AC", "id": "data/BO", "key": "BO", "name": "BOLIVIA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lang": "pt", "upper": "CS", "sub_zipexs": "69900-000,69999-999~57000-000,57999-999~68900-000,68999-999~69000-000,69299-999:69400-000,69899-999~40000-000,48999-999~60000-000,63999-999~70000-000,72799-999:73000-000,73699-999~29000-000,29999-999~72800-000,72999-999:73700-000,76999-999~65000-000,65999-999~78000-000,78899-999~79000-000,79999-999~30000-000,39999-999~66000-000,68899-999~58000-000,58999-999~80000-000,87999-999~50000-000,56999-999~64000-000,64999-999~20000-000,28999-999~59000-000,59999-999~90000-000,99999-999~76800-000,78900-000,78999-999~69300-000,69399-999~88000-000,89999-999~01000-000,09999-999:11000-000,19999-999~49000-000,49999-999~77000-000,77999-999", "zipex": "40301-110,70002-900", "name": "BRAZIL", "zip": "\\d{5}[\\-]?\\d{3}", "sub_mores": "true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true~true", "require": "ASCZ", "fmt": "%O%n%N%n%A%n%C-%S%n%Z", "state_name_type": "state", "languages": "pt", "sub_keys": "AC~AL~AP~AM~BA~CE~DF~ES~GO~MA~MT~MS~MG~PA~PB~PR~PE~PI~RJ~RN~RS~RO~RR~SC~SP~SE~TO", "key": "BR", "posturl": "http://www.correios.com.br/servicos/cep/cep_default.cfm", "id": "data/BR", "sub_names": "Acre~Alagoas~Amapá~Amazonas~Bahia~Ceará~Distrito Federal~Espírito Santo~Goiás~Maranhão~Mato Grosso~Mato Grosso do Sul~Minas Gerais~Pará~Paraíba~Paraná~Pernambuco~Piauí~Rio de Janeiro~Rio Grande do Norte~Rio Grande do Sul~Rondônia~Roraima~Santa Catarina~São Paulo~Sergipe~Tocantins", "sub_zips": "699~57~689~69[0-24-8]~4[0-8]~6[0-3]~7[0-1]|72[0-7]|73[0-6]~29~72[89]|73[7-9]|7[4-6]~65~78[0-8]~79~3~6[6-7]|68[0-8]~58~8[0-7]~5[0-6]~64~2[0-8]~59~9~76[89]|789~693~8[89]~[01][1-9]~49~77"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lang": "en", "name": "BAHAMAS", "fmt": "%N%n%O%n%A%n%C, %S", "state_name_type": "island", "languages": "en", "sub_keys": "ABACO~ACKLINS~ANDROS~BERRY ISLANDS~BIMINI~CAT ISLAND~CROOKED ISLAND~ELEUTHERA~EXUMA~GRAND BAHAMA~HARBOUR ISLAND~INAGUA~LONG ISLAND~MAYAGUANA~N.P.~RAGGED ISLAND~RUM CAY~SAN SALVADOR~SPANISH WELLS", "key": "BS", "sub_isoids": "~AK~~BY~BI~CI~~~EX~~HI~IN~LI~MG~~RI~RC~SS~SW", "id": "data/BS", "sub_names": "Abaco Islands~Acklins~Andros Island~Berry Islands~Bimini~Cat Island~Crooked Island~Eleuthera~Exuma and Cays~Grand Bahama~Harbour Island~Inagua~Long Island~Mayaguana~New Providence~Ragged Island~Rum Cay~San Salvador~Spanish Wells"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "11001,31101,35003", "posturl": "http://www.bhutanpost.com.bt/postcode/postcode.php", "zip": "\\d{5}", "key": "BT", "id": "data/BT", "name": "BHUTAN"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/BV", "key": "BV", "name": "BOUVET ISLAND"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "data/BW", "key": "BW", "name": "BOTSWANA"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zipex": "20050,223016,225860,220050", "posturl": "http://zip.belpost.by", "zip": "\\d{6}", "fmt": "%S%n%Z %C %X%n%A%n%O%n%N", "key": "BY", "id": "data/BY", "name": "BELARUS"} |
Oops, something went wrong.