├── addressformatting ├── py.typed ├── __init__.py ├── util.py ├── format.py └── data │ └── worldwide.yml ├── setup.cfg ├── MANIFEST.in ├── .gitignore ├── Makefile ├── .bumpversion.cfg ├── tests └── test_germany.py ├── .github └── workflows │ └── ci.yml ├── setup.py ├── LICENSE.txt └── README.md /addressformatting/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal = 1 3 | 4 | [metadata] 5 | description-file = README.md 6 | license_file = LICENSE.txt -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include addressformatting/data/worldwide.yml 2 | include addressformatting/py.typed 3 | include README.md 4 | include LICENSE.txt 5 | -------------------------------------------------------------------------------- /addressformatting/__init__.py: -------------------------------------------------------------------------------- 1 | from addressformatting.format import AddressFormatter 2 | 3 | __version__ = "1.3.2" 4 | __all__ = ["AddressFormatter"] 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out.png 2 | dump.json 3 | __pycache__ 4 | *.pyc 5 | .idea/ 6 | .vscode/ 7 | *.egg-info 8 | dist/ 9 | build/ 10 | .mypy_cache/ 11 | .tox 12 | .pytest_cache 13 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | update: 4 | curl -O addressformatting/data/worldwide.yaml https://raw.githubusercontent.com/OpenCageData/address-formatting/master/conf/countries/worldwide.yaml 5 | 6 | test: 7 | pytest -------------------------------------------------------------------------------- /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 1.3.2 3 | commit = True 4 | tag = True 5 | 6 | [bumpversion:file:setup.py] 7 | search = version="{current_version}" 8 | replace = version="{new_version}" 9 | 10 | [bumpversion:file:addressformatting/__init__.py] 11 | -------------------------------------------------------------------------------- /tests/test_germany.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from addressformatting import AddressFormatter 3 | 4 | 5 | class TestAddressFormatterGermany(unittest.TestCase): 6 | def test_street(self): 7 | formatter = AddressFormatter() 8 | self.assertEqual( 9 | "Bahnhofstr. 10, 86150 Augsburg, Germany", 10 | formatter.one_line( 11 | { 12 | "road": "Bahnhofstr.", 13 | "house_number": "10", 14 | "postcode": "86150", 15 | "city": "Augsburg", 16 | "state": "Bayern", 17 | "country": "Germany", 18 | }, 19 | country="DE", 20 | ), 21 | ) 22 | 23 | 24 | if __name__ == "__main__": 25 | unittest.main() 26 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Build and publish 2 | 3 | on: [push] 4 | 5 | jobs: 6 | deploy: 7 | runs-on: ubuntu-latest 8 | environment: deploy 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Set up Python 13 | uses: actions/setup-python@v2 14 | with: 15 | python-version: "3.7" 16 | - name: Install dependencies 17 | run: | 18 | python -m pip install --upgrade pip setuptools 19 | pip install -e ".[dev]" 20 | - name: Run tests 21 | run: | 22 | pytest . 23 | - name: Build a distribution 24 | run: | 25 | python setup.py sdist bdist_wheel 26 | - name: Publish to PyPI 27 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') 28 | uses: pypa/gh-action-pypi-publish@master 29 | with: 30 | user: __token__ 31 | password: ${{ secrets.pypi_password }} 32 | packages_dir: dist/ 33 | -------------------------------------------------------------------------------- /addressformatting/util.py: -------------------------------------------------------------------------------- 1 | import chevron # type: ignore 2 | from typing import cast, Callable, Dict 3 | 4 | RenderFunc = Callable[[str, Dict[str, str]], str] 5 | 6 | 7 | def render(template: str, context: Dict[str, str]) -> str: 8 | return cast(str, chevron.render(template, context)) 9 | 10 | 11 | def first(address: Dict[str, str]) -> Callable[[str, RenderFunc], str]: 12 | def _first(content: str, render: RenderFunc) -> str: 13 | tokens = [token.strip() for token in content.split("||")] 14 | for t in tokens: 15 | result = render(t, address) 16 | if result.strip() != "": 17 | return result 18 | return "" 19 | 20 | return _first 21 | 22 | 23 | def clean_address(full: str) -> str: 24 | # TODO: there's probably a higher-performance way of doing this via 25 | # a regex or something. 26 | prev = None 27 | while prev != full: 28 | prev = full 29 | full = full.replace(" ,", ",") 30 | full = full.replace(",,", ",") 31 | full = full.replace(" ", " ") 32 | full = full.strip(",") 33 | full = full.strip() 34 | return full 35 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from setuptools import setup 3 | 4 | # allow setup.py to be run from any path 5 | os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) 6 | 7 | with open("README.md") as f: 8 | long_description = f.read() 9 | 10 | 11 | setup( 12 | name="addressformatting", 13 | version="1.3.2", 14 | description="Formatting utility for international postal addresses", 15 | long_description=long_description, 16 | long_description_content_type="text/markdown", 17 | url="https://github.com/pudo/addressformatting", 18 | author="Friedrich Lindenberg", 19 | author_email="friedrich@pudo.org", 20 | license="BSD", 21 | include_package_data=True, 22 | classifiers=[ 23 | "Development Status :: 5 - Production/Stable", 24 | "Intended Audience :: Developers", 25 | "License :: OSI Approved :: BSD License", 26 | "Programming Language :: Python", 27 | "Programming Language :: Python :: 3", 28 | "Programming Language :: Python :: 3.9", 29 | "Operating System :: OS Independent", 30 | ], 31 | keywords="address formatting, international", 32 | packages=["addressformatting"], 33 | scripts=[], 34 | install_requires=[ 35 | "PyYAML >= 5.0", 36 | "chevron >= 0.14.0", 37 | ], 38 | extras_require={ 39 | "dev": [ 40 | "pytest", 41 | "bump2version", 42 | "wheel>=0.29.0", 43 | "twine", 44 | ], 45 | }, 46 | ) 47 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2018-2020, Johannes Schriewer 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **UPDATE 2024-11-21:** The functionality in this repository has now been moved to `rigour`. See the documentation here: https://opensanctions.github.io/rigour/addresses/ 2 | 3 | --- 4 | 5 | ## International Address formatter 6 | 7 | This is a address formatter that can format addresses in multiple formats that are common 8 | in different countries. 9 | 10 | For formatting the addresses the `worldwide.yml` from [OpenCageData address-formatting repository](https://github.com/OpenCageData/address-formatting) is used to format the address according to customs in the country that is been encoded. 11 | 12 | ## API documentation 13 | 14 | The complete project contains actually only one class: 15 | 16 | ### `AddressFormatter` 17 | 18 | Publicly accessible method prototypes are: 19 | 20 | ```python 21 | def __init__(self, config=None): 22 | pass 23 | 24 | def format(self, address, country=None): 25 | pass 26 | 27 | def one_line(self, address, country=None): 28 | pass 29 | ``` 30 | 31 | #### `__init__` 32 | 33 | Initialize the address formatter 34 | - `config`: (optional) override default config file to use for the address formatter, defaults to config file included in this package 35 | 36 | #### `format` 37 | 38 | Format an address in the default layout used in the specified country. Return value may contain line breaks. 39 | - `address`: Dictionary that contains the address parts, see below for recognized keys 40 | - `country`: Country code of the formatting template to use 41 | 42 | Recognized keys in `address`: 43 | - `attention` 44 | - `house` 45 | - `road` 46 | - `house_number` 47 | - `postcode` 48 | - `city` 49 | - `town` 50 | - `village` 51 | - `county` 52 | - `state` 53 | - `country` 54 | - `suburb` 55 | - `city_district` 56 | - `state_district` 57 | - `state_code` 58 | - `neighbourhood` 59 | 60 | #### `one_line` 61 | 62 | Works the same as `format` but returns a single line of text. 63 | -------------------------------------------------------------------------------- /addressformatting/format.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import Dict, Optional 3 | import yaml 4 | 5 | from addressformatting.util import clean_address, first, render 6 | 7 | PACKAGE_DIR = os.path.dirname(os.path.abspath(__file__)) 8 | TEMPLATE_FILE = os.path.join(PACKAGE_DIR, "data/worldwide.yml") 9 | TEMPLATE_FILE = os.path.abspath(TEMPLATE_FILE) 10 | 11 | 12 | class AddressFormatter: 13 | def __init__(self) -> None: 14 | with open(TEMPLATE_FILE, "r", encoding="utf-8") as fp: 15 | self.model: Dict[str, Dict[str, str]] = yaml.load( 16 | fp, Loader=yaml.FullLoader 17 | ) 18 | 19 | def _format( 20 | self, address: Dict[str, Optional[str]], country: Optional[str] = None 21 | ) -> str: 22 | search_key = country.upper() if country is not None else "default" 23 | fmt = self.model.get(search_key, None) 24 | if fmt is None: 25 | fmt = self.model.get("default", None) 26 | if fmt is None: 27 | raise RuntimeError("Missing the default address model!") 28 | 29 | # Some country configurations redirect to other countries but 30 | # change the country name in the process: 31 | use_country = fmt.get("use_country") 32 | if use_country is not None: 33 | country = fmt.get("change_country") 34 | if country is not None: 35 | address["country"] = country 36 | return self._format(address, country=use_country) 37 | 38 | cleaned_address: Dict[str, str] = {} 39 | for key, value in address.items(): 40 | if value is not None: 41 | cleaned_address[key] = value 42 | 43 | cleaned_address["first"] = first(cleaned_address) # type: ignore 44 | return render(fmt["address_template"], cleaned_address) 45 | 46 | def format( 47 | self, address: Dict[str, Optional[str]], country: Optional[str] = None 48 | ) -> str: 49 | return clean_address(self._format(address, country=country)) 50 | 51 | def one_line( 52 | self, address: Dict[str, Optional[str]], country: Optional[str] = None 53 | ) -> str: 54 | line = ", ".join(self.format(address, country=country).split("\n")) 55 | return clean_address(line) 56 | -------------------------------------------------------------------------------- /addressformatting/data/worldwide.yml: -------------------------------------------------------------------------------- 1 | # 2 | # generic mappings, specific territories get mapped to these 3 | # 4 | # postcode before city 5 | generic1: &generic1 | 6 | {{{attention}}} 7 | {{{house}}} 8 | {{{road}}} {{{house_number}}} 9 | {{{postcode}}} {{#first}} {{{postal_city}}} || {{{town}}} || {{{city}}} || {{{village}}} || {{{municipality}}} || {{{county}}} || {{{state}}} {{/first}} 10 | {{{archipelago}}} 11 | {{{country}}} 12 | 13 | # postcode after city 14 | generic2: &generic2 | 15 | {{{attention}}} 16 | {{#first}} {{{house}}}, {{{quarter}}} || {{{house}}} {{/first}} 17 | {{{house_number}}} {{{road}}} 18 | {{#first}} {{{village}}} || {{{city}}} || {{{town}}} || {{{municipality}}} || {{{county}}} {{/first}} {{{postcode}}} 19 | {{#first}} {{{country}}} || {{{state}}} {{/first}} 20 | 21 | # postcode before city 22 | generic3: &generic3 | 23 | {{{attention}}} 24 | {{{house}}} 25 | {{{house_number}}} {{{road}}} 26 | {{{postcode}}} {{#first}} {{{town}}} || {{{village}}} || {{{city}}} || {{{municipality}}} || {{{state}}} {{/first}} 27 | {{{country}}} 28 | 29 | # postcode after state 30 | generic4: &generic4 | 31 | {{{attention}}} 32 | {{{house}}} 33 | {{{house_number}}} {{{road}}} 34 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{suburb}}} || {{{municipality}}} || {{{county}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}} 35 | {{{country}}} 36 | 37 | # no postcode 38 | generic5: &generic5 | 39 | {{{attention}}} 40 | {{{house}}} 41 | {{{house_number}}} {{{road}}} 42 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 43 | {{#first}} {{{state_district}}} || {{{state}}} {{/first}} 44 | {{{country}}} 45 | 46 | # no postcode, county 47 | generic6: &generic6 | 48 | {{{attention}}} 49 | {{{house}}} 50 | {{{house_number}}} {{{road}}} 51 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 52 | {{{county}}} 53 | {{{country}}} 54 | 55 | # city, postcode 56 | generic7: &generic7 | 57 | {{{attention}}} 58 | {{{house}}} 59 | {{{road}}} {{{house_number}}} 60 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{{postcode}}} 61 | {{{country}}} 62 | 63 | # postcode and county 64 | generic8: &generic8 | 65 | {{{attention}}} 66 | {{{house}}} 67 | {{{road}}}, {{{house_number}}} 68 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} {{#first}} {{{county_code}}} || {{{county}}} {{/first}} 69 | {{{country}}} 70 | 71 | generic9: &generic9 | 72 | {{{attention}}} 73 | {{{house}}} 74 | {{{road}}} {{{house_number}}} 75 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 76 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} 77 | {{{country}}} 78 | 79 | generic10: &generic10 | 80 | {{{attention}}} 81 | {{{house}}} 82 | {{{road}}} {{{house_number}}} 83 | {{#first}} {{{suburb}}} || {{{city_district}}} {{/first}} 84 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 85 | {{{state}}} 86 | {{{country}}} 87 | {{{postcode}}} 88 | 89 | generic11: &generic11 | 90 | {{{country}}} 91 | {{{state}}} 92 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 93 | {{{suburb}}} 94 | {{{road}}}, {{{house_number}}} 95 | {{{house}}} 96 | {{{attention}}} 97 | 98 | # city - postcode 99 | generic12: &generic12 | 100 | {{{attention}}} 101 | {{{house}}} 102 | {{{house_number}}}, {{{road}}} 103 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 104 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} - {{{postcode}}} 105 | {{{state}}} 106 | {{{country}}} 107 | 108 | generic13: &generic13 | 109 | {{{attention}}} 110 | {{{house}}} 111 | {{{house_number}}} {{{road}}} 112 | {{#first}} {{{suburb}}} || {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{region}}} {{/first}} {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}} 113 | {{{country}}} 114 | 115 | # postcode and state 116 | generic14: &generic14 | 117 | {{{attention}}} 118 | {{{house}}} 119 | {{{house_number}}} {{{road}}} 120 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state_district}}} {{/first}} 121 | {{{state}}} 122 | {{{country}}} 123 | 124 | # postcode and comma before house number 125 | generic15: &generic15 | 126 | {{{attention}}} 127 | {{{house}}} 128 | {{{road}}}, {{{house_number}}} 129 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} || {{{state}}} || {{{county}}} {{/first}} 130 | {{{country}}} 131 | 132 | # no postcode, no state, just city 133 | generic16: &generic16 | 134 | {{{attention}}} 135 | {{{house}}} 136 | {{{house_number}}} {{{road}}} 137 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} 138 | {{{country}}} 139 | 140 | # no postcode, no state, just city 141 | generic17: &generic17 | 142 | {{{attention}}} 143 | {{{house}}} 144 | {{{road}}} {{{house_number}}} 145 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} 146 | {{{country}}} 147 | 148 | # no postcode, just city comma after house number 149 | generic18: &generic18 | 150 | {{{attention}}} 151 | {{{house}}} 152 | {{{house_number}}}, {{{road}}} 153 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{state}}} {{/first}} 154 | {{{country}}} 155 | 156 | # suburb and postcode after city 157 | generic19: &generic19 | 158 | {{{attention}}} 159 | {{{house}}} 160 | {{{road}}} {{{house_number}}} 161 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 162 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} {{{postcode}}} 163 | {{{country}}} 164 | 165 | # suburb and postcode after city 166 | generic20: &generic20 | 167 | {{{attention}}} 168 | {{{house}}} 169 | {{{house_number}}} {{{road}}} 170 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 171 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} {{{postcode}}} 172 | {{{country}}} 173 | 174 | # suburb and city, no postcode 175 | generic21: &generic21 | 176 | {{{attention}}} 177 | {{{house}}} 178 | {{{road}}} {{{house_number}}} 179 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 180 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} 181 | {{{country}}} 182 | 183 | # comma after housenumber, postcode before city 184 | generic22: &generic22 | 185 | {{{attention}}} 186 | {{{house}}} 187 | {{{house_number}}}, {{{road}}} 188 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} 189 | {{{country}}} 190 | 191 | fallback1: &fallback1 | 192 | {{{attention}}} 193 | {{{house}}} 194 | {{{road}}} {{{house_number}}} 195 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{island}}} {{/first}} 196 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 197 | {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} || {{{region}}} {{/first}} 198 | {{{country}}} 199 | 200 | fallback2: &fallback2 | 201 | {{{attention}}} 202 | {{{house}}} 203 | {{{road}}} {{{house_number}}} 204 | {{#first}} {{{suburb}}} || {{{village}}} {{/first}} 205 | {{#first}} {{{city}}} || {{{town}}} || {{{municipality}}} || {{{county}}} || {{{island}}} || {{{state_district}}} {{/first}}, {{#first}} {{{state}}} || {{{state_code}}} {{/first}} 206 | {{{country}}} 207 | 208 | fallback3: &fallback3 | 209 | {{{attention}}} 210 | {{{house}}} 211 | {{{road}}} {{{house_number}}} 212 | {{#first}} {{{suburb}}} || {{{island}}} {{/first}} 213 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 214 | {{{county}}} 215 | {{#first}} {{{state}}} || {{{state_code}}} {{/first}} 216 | {{{country}}} 217 | 218 | fallback4: &fallback4 | 219 | {{{attention}}} 220 | {{{house}}} 221 | {{{road}}} {{{house_number}}} 222 | {{{suburb}}} 223 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 224 | {{#first}} {{{state}}} || {{{county}}} {{/first}} 225 | {{{country}}} 226 | 227 | default: 228 | address_template: *generic1 229 | fallback_template: *fallback1 230 | 231 | # country / territory specific mappings 232 | # please keep in alpha order by country code 233 | # 234 | 235 | # Andorra 236 | AD: 237 | address_template: *generic3 238 | 239 | # United Arab Emirates 240 | AE: 241 | address_template: | 242 | {{{attention}}} 243 | {{{house}}} 244 | {{{house_number}}} {{{road}}} 245 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 246 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 247 | {{#first}} {{{state_district}}} || {{{state}}} {{/first}} 248 | {{{country}}} 249 | # Afghanistan 250 | AF: 251 | address_template: *generic21 252 | 253 | # Antigua and Barbuda 254 | AG: 255 | address_template: *generic16 256 | 257 | # Anguilla 258 | AI: 259 | address_template: | 260 | {{{attention}}} 261 | {{{house}}} 262 | {{{road}}} {{{house_number}}} 263 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 264 | {{{postcode}}} {{{country}}} 265 | # Albania 266 | AL: 267 | address_template: | 268 | {{{attention}}} 269 | {{{house}}} 270 | {{{road}}} {{{house_number}}} 271 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} 272 | {{{country}}} 273 | postformat_replace: 274 | # fix the postcode to add - after numbers 275 | - ["\n(\\d{4}) ([^,]*)\n", "\n$1-$2\n"] 276 | 277 | # Armenia 278 | AM: 279 | address_template: | 280 | {{{attention}}} 281 | {{{house}}} 282 | {{{house_number}}} {{{road}}} 283 | {{{postcode}}} 284 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 285 | {{#first}} {{{state_district}}} || {{{state}}} {{/first}} 286 | {{{country}}} 287 | # Angola 288 | AO: 289 | address_template: *generic7 290 | 291 | # Antarctica 292 | AQ: 293 | address_template: | 294 | {{{attention}}} 295 | {{{house}}} 296 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 297 | {{#first}} {{{country}}} || {{{continent}}} {{/first}} 298 | # Argentina 299 | AR: 300 | address_template: *generic9 301 | replace: 302 | - ["^Autonomous City of ", ""] 303 | postformat_replace: 304 | # fix the postcode to make it \w\d\d\d\d \w\w\w 305 | - ["\n(\\w\\d{4})(\\w{3}) ", "\n$1 $2 "] 306 | 307 | # American Samoa 308 | AS: 309 | use_country: US 310 | change_country: United States of America 311 | add_component: state=American Samoa 312 | 313 | # Austria 314 | AT: 315 | address_template: *generic1 316 | 317 | # Australia 318 | AU: 319 | address_template: *generic13 320 | 321 | # Aruba 322 | AW: 323 | address_template: *generic17 324 | 325 | # Åland Islands, part of Finnland 326 | AX: 327 | use_country: FI 328 | change_country: Åland, Finland 329 | 330 | # Azerbaijan 331 | AZ: 332 | address_template: *generic3 333 | 334 | # Bosnia 335 | BA: 336 | address_template: *generic1 337 | 338 | # Barbados 339 | BB: 340 | address_template: *generic16 341 | 342 | # Bangladesh 343 | BD: 344 | address_template: | 345 | {{{attention}}} 346 | {{{house}}} 347 | {{{house_number}}} {{{road}}} 348 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 349 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} - {{{postcode}}} 350 | {{{country}}} 351 | # Belgium 352 | BE: 353 | address_template: *generic1 354 | 355 | # Burkina Faso 356 | BF: 357 | address_template: *generic6 358 | 359 | # Bulgaria 360 | BG: 361 | address_template: *generic9 362 | 363 | # Bahrain 364 | BH: 365 | address_template: *generic2 366 | 367 | # Burundi 368 | BI: 369 | address_template: *generic17 370 | 371 | # Benin 372 | BJ: 373 | address_template: *generic18 374 | 375 | # Saint Barthélemy - same as FR 376 | BL: 377 | use_country: FR 378 | change_country: Saint-Barthélemy, France 379 | 380 | # Bermuda 381 | BM: 382 | address_template: *generic2 383 | 384 | # Brunei 385 | BN: 386 | address_template: | 387 | {{{attention}}} 388 | {{{house}}} 389 | {{{house_number}}}, {{{road}}} 390 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 391 | {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} {{{postcode}}} 392 | {{{country}}} 393 | # Bolivia 394 | BO: 395 | address_template: *generic17 396 | replace: 397 | - ["^Municipio Nuestra Senora de ", ""] 398 | 399 | # Dutch Caribbean / Bonaire 400 | BQ: 401 | use_country: NL 402 | change_country: Caribbean Netherlands 403 | 404 | # Brazil 405 | BR: 406 | address_template: | 407 | {{{attention}}} 408 | {{{house}}} 409 | {{{road}}} {{{house_number}}} 410 | {{#first}} {{{suburb}}} || {{{city_district}}} {{/first}} 411 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} - {{#first}} {{{state_code}}} || {{{state}}} {{/first}} 412 | {{{postcode}}} 413 | {{{country}}} 414 | postformat_replace: 415 | - ["\\b(\\d{5})(\\d{3})\\b", "$1-$2"] 416 | 417 | # Bahamas 418 | BS: 419 | address_template: | 420 | {{{attention}}} 421 | {{{house}}} 422 | {{{road}}} {{{house_number}}} 423 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 424 | {{{county}}} 425 | {{{country}}} 426 | # Bhutan 427 | BT: 428 | address_template: | 429 | {{{attention}}} 430 | {{{house}}} 431 | {{{road}}} {{{house_number}}}, {{{house}}} 432 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 433 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} {{{postcode}}} 434 | {{{country}}} 435 | # Bouvet Island 436 | BV: 437 | use_country: "NO" 438 | change_country: Bouvet Island, Norway 439 | 440 | # Botswana 441 | BW: 442 | address_template: | 443 | {{{attention}}} 444 | {{{house}}} 445 | {{{road}}} {{{house_number}}} 446 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 447 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 448 | {{{country}}} 449 | # Belarus 450 | BY: 451 | address_template: *generic11 452 | 453 | # Belize 454 | BZ: 455 | address_template: *generic16 456 | 457 | # Canada 458 | CA: 459 | address_template: | 460 | {{{attention}}} 461 | {{{house}}} 462 | {{#first}} {{{house_number}}} {{{road}}} || {{{suburb}}} {{/first}} 463 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}} 464 | {{{country}}} 465 | fallback_template: | 466 | {{{attention}}} 467 | {{{house}}} 468 | {{#first}} {{{house_number}}} {{{road}}} || {{{suburb}}} {{/first}} 469 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}} 470 | {{{country}}} 471 | postformat_replace: 472 | # fix the postcode to make it \w\w\w \w\w\w 473 | - [" (\\w{2}) (\\w{3})(\\w{3})\n", " $1 $2 $3\n"] 474 | 475 | # Cocos (Keeling) Islands 476 | CC: 477 | use_country: AU 478 | change_country: Australia 479 | 480 | # Democratic Republic of the Congo 481 | CD: 482 | address_template: *generic18 483 | 484 | # Central African Republic 485 | CF: 486 | address_template: *generic17 487 | 488 | # Republic of the Congo / Congo-Brazzaville 489 | CG: 490 | address_template: *generic18 491 | 492 | # Switzerland 493 | CH: 494 | address_template: *generic1 495 | 496 | # Côte d'Ivoire 497 | CI: 498 | address_template: *generic16 499 | 500 | # Cook Islands 501 | CK: 502 | address_template: *generic16 503 | 504 | # Chile 505 | CL: 506 | address_template: *generic1 507 | postformat_replace: 508 | # fix the postcode to make it \d\d\d \d\d\d\d 509 | - ["\n(\\d{3})(\\d{4}) ", "\n$1 $2 "] 510 | 511 | # Cameroon 512 | CM: 513 | address_template: *generic17 514 | 515 | # China 516 | CN: 517 | address_template: | 518 | {{{attention}}} 519 | {{{house}}} 520 | {{{house_number}}} {{{road}}} 521 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 522 | {{{county}}} 523 | {{{postcode}}} {{#first}} {{{state_code}}} || {{{state}}} || {{{city}}} || {{{town}}} || {{{municipality}}} || {{{state_district}}} || {{{region}}} || {{{village}}} {{/first}} 524 | {{{country}}} 525 | # China - English 526 | CN_en: 527 | address_template: | 528 | {{{attention}}} 529 | {{{house}}} 530 | {{{house_number}}} {{{road}}} 531 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 532 | {{{county}}} 533 | {{{postcode}}} {{#first}} {{{state_code}}} || {{{state}}} || {{{city}}} || {{{town}}} || {{{municipality}}} || {{{state_district}}} || {{{region}}} || {{{village}}} {{/first}} 534 | {{{country}}} 535 | # China - Chinese 536 | CN_zh: 537 | address_template: | 538 | {{{country}}} 539 | {{{postcode}}} 540 | {{#first}} {{{state_code}}} || {{{state}}} || {{{region}}} {{/first}} 541 | {{#first}} {{{state_district}}} || {{{county}}} {{/first}} 542 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 543 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 544 | {{{road}}} 545 | {{{house_number}}} 546 | {{{house}}} 547 | {{{attention}}} 548 | # Colombia 549 | CO: 550 | address_template: | 551 | {{{attention}}} 552 | {{{house}}} 553 | {{{road}}} {{{house_number}}} 554 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 555 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} 556 | {{{country}}} 557 | postformat_replace: 558 | - ["Bogota, Bogota", "Bogota"] 559 | 560 | # Costa Rica 561 | CR: 562 | address_template: | 563 | {{{attention}}} 564 | {{{house}}} 565 | {{{road}}} {{{house_number}}} 566 | {{{state}}}, {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}}, {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 567 | {{{postcode}}} {{{country}}} 568 | # Cuba 569 | CU: 570 | address_template: *generic7 571 | 572 | # Cape Verde 573 | CV: 574 | address_template: *generic1 575 | postformat_replace: 576 | # fix the postcode to add - after numbers 577 | - ["\n(\\d{4}) ([^,]*)\n", "\n$1-$2\n"] 578 | 579 | # Curaçao 580 | CW: 581 | address_template: *generic17 582 | 583 | # Christmas Island - same as Australia 584 | CX: 585 | use_country: AU 586 | add_component: state=Christmas Island 587 | change_country: Australia 588 | 589 | # Cyprus 590 | CY: 591 | address_template: *generic1 592 | 593 | # Czech Republic 594 | CZ: 595 | address_template: *generic1 596 | postformat_replace: 597 | # fix the postcode to make it \d\d\d \d\d 598 | - ["\n(\\d{3})(\\d{2}) ", "\n$1 $2 "] 599 | 600 | # Germany 601 | DE: 602 | address_template: *generic1 603 | fallback_template: | 604 | {{{attention}}} 605 | {{{house}}} 606 | {{{road}}} {{{house_number}}} 607 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 608 | {{#first}} {{{town}}} || {{{city}}} || {{{village}}} || {{{municipality}}} || {{{county}}} {{/first}} 609 | {{#first}} {{{state}}} || {{{state_district}}} {{/first}} 610 | {{{country}}} 611 | 612 | replace: 613 | - ["^Stadtteil ", ""] 614 | - ["^Stadtbezirk (\\d+)", ""] 615 | - ["^Ortsbeirat (\\d+) :", ""] 616 | - ["^Gemeinde ", ""] 617 | - ["^Gemeindeverwaltungsverband ", ""] 618 | - ["^Landkreis ", ""] 619 | - ["^Kreis ", ""] 620 | - ["^Grenze ", ""] 621 | - ["^Free State of ", ""] 622 | - ["^Freistaat ", ""] 623 | - ["^Regierungsbezirk ", ""] 624 | - ["^Gemeindefreies Gebiet ", ""] 625 | - ["city=Alt-Berlin", "Berlin"] 626 | postformat_replace: 627 | - ["Berlin\nBerlin", "Berlin"] 628 | - ["Bremen\nBremen", "Bremen"] 629 | - ["Hamburg\nHamburg", "Hamburg"] 630 | 631 | # Djibouti 632 | DJ: 633 | address_template: *generic16 634 | replace: 635 | - ["city=Djibouti", "Djibouti-Ville"] 636 | 637 | # Denmark 638 | DK: 639 | address_template: *generic1 640 | 641 | # Dominica 642 | DM: 643 | address_template: *generic16 644 | 645 | # Dominican Republic 646 | DO: 647 | address_template: | 648 | {{{attention}}} 649 | {{{house}}} 650 | {{{road}}} {{{house_number}}} 651 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 652 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{{state}}} 653 | {{{postcode}}} 654 | {{{country}}} 655 | postformat_replace: 656 | - [", Distrito Nacional", ", DN"] 657 | 658 | # Algeria 659 | DZ: 660 | address_template: *generic3 661 | 662 | # Ecuador 663 | EC: 664 | address_template: | 665 | {{{attention}}} 666 | {{{house}}} 667 | {{{road}}} {{{house_number}}} 668 | {{{postcode}}} 669 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} 670 | {{{country}}} 671 | # Egypt 672 | EG: 673 | address_template: | 674 | {{{attention}}} 675 | {{{house}}} 676 | {{{house_number}}} {{{road}}} 677 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 678 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 679 | {{{postcode}}} 680 | {{{country}}} 681 | # Estonia 682 | EE: 683 | address_template: *generic1 684 | 685 | # Western Sahara 686 | EH: 687 | address_template: *generic17 688 | 689 | # Eritrea 690 | ER: 691 | address_template: *generic17 692 | 693 | # Spain 694 | ES: 695 | address_template: *generic15 696 | fallback_template: *fallback4 697 | 698 | # Ethiopia 699 | ET: 700 | address_template: *generic1 701 | 702 | # Finnland 703 | FI: 704 | address_template: *generic1 705 | 706 | # Fiji 707 | FJ: 708 | address_template: *generic16 709 | 710 | # Falkland Islands 711 | FK: 712 | use_country: GB 713 | change_country: Falkland Islands, United Kingdom 714 | 715 | # Federated States of Micronesia 716 | FM: 717 | use_country: US 718 | change_country: United States of America 719 | add_component: state=Micronesia 720 | 721 | # Faroe Islands 722 | FO: 723 | address_template: *generic1 724 | postformat_replace: 725 | - ["Territorial waters of Faroe Islands", "Faroe Islands"] 726 | 727 | # France 728 | FR: 729 | address_template: *generic3 730 | replace: 731 | - [ 732 | "Polynésie française, Îles du Vent \\(eaux territoriales\\)", 733 | "Polynésie française", 734 | ] 735 | - ["France, Mayotte \\(eaux territoriales\\)", "Mayotte, France"] 736 | - ["France, La Réunion \\(eaux territoriales\\)", "La Réunion, France"] 737 | - ["Grande Terre et récifs d'Entrecasteaux", ""] 738 | - ["France, Nouvelle-Calédonie", "Nouvelle-Calédonie, France"] 739 | - ["\\(eaux territoriales\\)", ""] 740 | 741 | # Gabon 742 | GA: 743 | address_template: | 744 | {{{attention}}} 745 | {{{house}}} 746 | {{{house_number}}} {{{road}}} 747 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{village}}} {{/first}} 748 | {{#first}} {{{city}}} || {{{town}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} 749 | {{{country}}} 750 | GB: 751 | address_template: *generic2 752 | fallback_template: *fallback3 753 | replace: 754 | - ["^Borough of ", ""] 755 | - ["^County( of)? ", ""] 756 | - ["^Parish of ", ""] 757 | - ["^Central ", ""] 758 | - ["^Greater London", "London"] 759 | - ["^London Borough of .+", "London"] 760 | - ["Royal Borough of ", ""] 761 | - ["County Borough of ", ""] 762 | postformat_replace: 763 | - ["London, London", "London"] 764 | - ["London, Greater London", "London"] 765 | - ["City of Westminster", "London"] 766 | - ["City of Nottingham", "Nottingham"] 767 | - [", United Kingdom$", "\nUnited Kingdom"] 768 | - ["London\nEngland\nUnited Kingdom", "London\nUnited Kingdom"] 769 | 770 | # Grenada 771 | GD: 772 | address_template: *generic17 773 | 774 | # Georgia 775 | GE: 776 | address_template: *generic1 777 | 778 | # French Guiana - same as FR 779 | GF: 780 | use_country: FR 781 | change_country: France 782 | 783 | # Guernsey - same format as UK, but not part of UK 784 | GG: 785 | use_country: GB 786 | change_country: Guernsey, Channel Islands 787 | 788 | # Ghana 789 | GH: 790 | address_template: *generic16 791 | 792 | # Gibraltar 793 | GI: 794 | address_template: *generic16 795 | 796 | # Greenland 797 | GL: 798 | address_template: *generic1 799 | 800 | # The Gambia 801 | GM: 802 | address_template: *generic16 803 | 804 | # Guinea 805 | GN: 806 | address_template: *generic14 807 | 808 | # Guadeloupe - same as FR 809 | GP: 810 | use_country: FR 811 | change_country: Guadeloupe, France 812 | 813 | # Equatorial Guinea 814 | GQ: 815 | address_template: *generic17 816 | 817 | # Greece 818 | GR: 819 | address_template: *generic1 820 | postformat_replace: 821 | # fix the postcode to make it \d\d\d \d\d 822 | - ["\n(\\d{3})(\\d{2}) ", "\n$1 $2 "] 823 | 824 | # South Georgia and the South Sandwich Islands - same as UK 825 | GS: 826 | use_country: GB 827 | change_country: United Kingdom 828 | add_component: county=South Georgia 829 | 830 | # Guatemala 831 | GT: 832 | address_template: | 833 | {{{attention}}} 834 | {{{house}}} 835 | {{{road}}} {{{house_number}}} 836 | {{{postcode}}}-{{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} || {{{state}}} {{/first}} 837 | {{{country}}} 838 | postformat_replace: 839 | - ["\n(\\d{5})- ", "\n$1-"] 840 | - ["\n -", "\n"] 841 | 842 | # Guam 843 | GU: 844 | use_country: US 845 | change_country: United States of America 846 | add_component: state=Guam 847 | 848 | # Guinea-Bissau 849 | GW: 850 | address_template: *generic1 851 | 852 | # Guyana 853 | GY: 854 | address_template: *generic16 855 | 856 | # Hong Kong 857 | HK: 858 | address_template: | 859 | {{{attention}}} 860 | {{{house}}} 861 | {{{house_number}}} {{{road}}} 862 | {{{state_district}}} 863 | {{#first}} {{{state}}} || {{{country}}} {{/first}} 864 | # Hong Kong - English 865 | HK_en: 866 | address_template: | 867 | {{{attention}}} 868 | {{{house}}} 869 | {{{house_number}}} {{{road}}} 870 | {{{state_district}}} 871 | {{{state}}} 872 | {{{country}}} 873 | # Hong Kong - Chinese 874 | HK_zh: 875 | address_template: | 876 | {{{country}}} 877 | {{{state}}} 878 | {{{state_district}}} 879 | {{{road}}} 880 | {{{house_number}}} 881 | {{{house}}} 882 | {{{attention}}} 883 | # Heard Island and McDonald Islands - same as Australia 884 | HM: 885 | use_country: AU 886 | change_country: Australia 887 | add_component: state=Heard Island and McDonald Islands 888 | 889 | # Honduras 890 | HN: 891 | address_template: *generic1 892 | 893 | # Croatia 894 | HR: 895 | address_template: *generic1 896 | 897 | # Haiti 898 | HT: 899 | address_template: *generic1 900 | postformat_replace: 901 | - [" Commune de", " "] 902 | 903 | # Hungary 904 | HU: 905 | address_template: | 906 | {{{attention}}} 907 | {{{house}}} 908 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 909 | {{{road}}} {{{house_number}}} 910 | {{{postcode}}} 911 | {{{country}}} 912 | # Indonesia 913 | # https://en.wikipedia.org/wiki/Address_%28geography%29#Indonesia 914 | ID: 915 | address_template: | 916 | {{{attention}}} 917 | {{{house}}} 918 | {{{road}}} {{{house_number}}} 919 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 920 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} {{{postcode}}} 921 | {{{state}}} 922 | {{{country}}} 923 | # Ireland 924 | # https://en.wikipedia.org/wiki/Postal_addresses_in_the_Republic_of_Ireland 925 | IE: 926 | address_template: | 927 | {{{attention}}} 928 | {{{house}}} 929 | {{{house_number}}} {{{road}}} 930 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 931 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 932 | {{{county}}} 933 | {{{country}}} 934 | replace: 935 | - [" City$", ""] 936 | - ["The Municipal District of ", ""] 937 | - ["The Metropolitan District of ", ""] 938 | postformat_replace: 939 | - ["Dublin\nCounty Dublin", "Dublin"] 940 | - ["Galway\nCounty Galway", "Galway"] 941 | - ["Kilkenny\nCounty Kilkenny", "Kilkenny"] 942 | - ["Limerick\nCounty Limerick", "Limerick"] 943 | - ["Tipperary\nCounty Tipperary", "Tipperary"] 944 | 945 | # Israel 946 | IL: 947 | address_template: *generic1 948 | 949 | # Isle of Man 950 | IM: 951 | address_template: *generic2 952 | 953 | # India 954 | # http://en.wikipedia.org/wiki/Address_%28geography%29#India 955 | IN: 956 | address_template: *generic12 957 | 958 | # British Indian Ocean Territory - same as UK 959 | IO: 960 | use_country: GB 961 | change_country: British Indian Ocean Territory, United Kingdom 962 | 963 | # Iraq 964 | IQ: 965 | address_template: | 966 | {{{attention}}} 967 | {{{house}}} 968 | {{{house_number}}} {{#first}} {{{city_district}}} || {{{neighbourhood}}} || {{{suburb}}} {{/first}} 969 | {{{road}}} 970 | {{#first}} {{{city}}} || {{{town}}} || {{{state}}} || {{{village}}} {{/first}} 971 | {{{postcode}}} 972 | {{{country}}} 973 | # Iran 974 | IR: 975 | address_template: | 976 | {{{attention}}} 977 | {{{house}}} 978 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 979 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 980 | {{{road}}} 981 | {{{house_number}}} 982 | {{#first}} {{{province}}} || {{{state}}} {{/first}} 983 | {{{postcode}}} 984 | {{{country}}} 985 | IR_en: 986 | address_template: | 987 | {{{attention}}} 988 | {{{house}}} 989 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 990 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 991 | {{{road}}} 992 | {{{house_number}}} 993 | {{#first}} {{{province}}} || {{{state}}} {{/first}} 994 | {{{postcode}}} 995 | {{{country}}} 996 | IR_fa: 997 | address_template: | 998 | {{{country}}} 999 | {{#first}} {{{state}}} || {{{province}}} {{/first}} 1000 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1001 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1002 | {{{road}}} 1003 | {{{house_number}}} 1004 | {{{house}}} 1005 | {{{attention}}} 1006 | {{{postcode}}} 1007 | # Iceland 1008 | IS: 1009 | address_template: *generic1 1010 | 1011 | # Italy 1012 | IT: 1013 | address_template: *generic8 1014 | replace: 1015 | - ["Città metropolitana di ", ""] 1016 | - ["Metropolitan City of ", ""] 1017 | postformat_replace: 1018 | - ["Vatican City\nVatican City$", "\nVatican City"] 1019 | - ["Città del Vaticano\nCittà del Vaticano$", "Città del Vaticano\n"] 1020 | 1021 | # Jersey - same format as UK, but not part of UK 1022 | JE: 1023 | use_country: GB 1024 | change_country: Jersey, Channel Islands 1025 | 1026 | # Jamaica 1027 | JM: 1028 | address_template: *generic20 1029 | 1030 | # Jordan 1031 | JO: 1032 | address_template: *generic1 1033 | 1034 | # Japan 1035 | JP: 1036 | address_template: | 1037 | {{{attention}}} 1038 | {{{house}}} 1039 | {{{house_number}}} {{{road}}} 1040 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1041 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{#first}} {{{state}}} || {{{state_district}}} {{/first}} {{{postcode}}} 1042 | {{{country}}} 1043 | postformat_replace: 1044 | # fix the postcode to make it \d\d\d-\d\d\d\d 1045 | - [" (\\d{3})(\\d{4})\n", " $1-$2\n"] 1046 | 1047 | # Japan - English 1048 | JP_en: 1049 | address_template: | 1050 | {{{attention}}} 1051 | {{{house}}} 1052 | {{{house_number}}} {{{road}}} 1053 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1054 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{#first}} {{{state}}} || {{{state_district}}} {{/first}} {{{postcode}}} 1055 | {{{country}}} 1056 | postformat_replace: 1057 | # fix the postcode to make it \d\d\d-\d\d\d\d 1058 | - [" (\\d{3})(\\d{4})\n", " $1-$2\n"] 1059 | 1060 | # Japan - Japanese 1061 | JP_ja: 1062 | address_template: | 1063 | {{{country}}} 1064 | {{{postcode}}} 1065 | {{#first}} {{{state}}} || {{{state_district}}} {{/first}} 1066 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1067 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1068 | {{{road}}} 1069 | {{{house_number}}} 1070 | {{{house}}} 1071 | {{{attention}}} 1072 | postformat_replace: 1073 | # fix the postcode to make it \d\d\d-\d\d\d\d 1074 | - [" (\\d{3})(\\d{4})\n", " $1-$2\n"] 1075 | 1076 | # Kenya 1077 | KE: 1078 | address_template: | 1079 | {{{attention}}} 1080 | {{{house}}} 1081 | {{{house_number}}} {{{road}}} 1082 | {{#first}} {{{city}}} || {{{town}}} || {{{state}}} || {{{village}}} {{/first}} 1083 | {{{postcode}}} 1084 | {{{country}}} 1085 | # Kyrgyzstan 1086 | KG: 1087 | address_template: *generic11 1088 | 1089 | # Cambodia 1090 | KH: 1091 | address_template: | 1092 | {{{attention}}} 1093 | {{{house}}} 1094 | {{{house_number}}} {{{road}}} 1095 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1096 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} {{{postcode}}} 1097 | {{{country}}} 1098 | # Kiribati 1099 | KI: 1100 | address_template: *generic17 1101 | 1102 | # Comoros 1103 | KM: 1104 | address_template: | 1105 | {{{attention}}} 1106 | {{{house}}} 1107 | {{{road}}} {{{house_number}}} 1108 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1109 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1110 | {{{country}}} 1111 | # Saint Kitts and Nevis 1112 | KN: 1113 | address_template: | 1114 | {{{attention}}} 1115 | {{{house}}} 1116 | {{{house_number}}} {{{road}}} 1117 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{#first}} {{{state}}} || {{{island}}} {{/first}} 1118 | {{{country}}} 1119 | # Democratic People's Republic of Korea / North Korea 1120 | KP: 1121 | address_template: | 1122 | {{{attention}}} 1123 | {{{house}}} 1124 | {{{road}}} {{{house_number}}} 1125 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1126 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1127 | {{#first}} {{{state}}} || {{{province}}} {{/first}} 1128 | {{{country}}} 1129 | 1130 | # Republic of Korea / South Korea 1131 | KR: 1132 | address_template: | 1133 | {{{attention}}} 1134 | {{{house}}} 1135 | {{{house_number}}} {{{road}}} 1136 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{#first}} {{{state}}} {{/first}} {{{postcode}}} 1137 | {{{country}}} 1138 | # South Korea - English 1139 | KR_en: 1140 | address_template: | 1141 | {{{attention}}} 1142 | {{{house}}} 1143 | {{{house_number}}} {{{road}}} 1144 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{#first}} {{{state}}} {{/first}} {{{postcode}}} 1145 | {{{country}}} 1146 | # South Korea - Korean 1147 | KR_ko: 1148 | address_template: | 1149 | {{{country}}} 1150 | {{#first}} {{{state}}} {{/first}} 1151 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1152 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1153 | {{{road}}} 1154 | {{{house_number}}} 1155 | {{{house}}} 1156 | {{{attention}}} 1157 | {{{postcode}}} 1158 | # Kuwait 1159 | KW: 1160 | address_template: | 1161 | {{{attention}}} 1162 | {{{house}}} 1163 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1164 | {{{road}}} 1165 | {{{house_number}}} {{{house}}} 1166 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1167 | {{{country}}} 1168 | # Cayman Islands 1169 | KY: 1170 | address_template: *generic2 1171 | 1172 | # Kazakhstan 1173 | KZ: 1174 | address_template: *generic11 1175 | 1176 | # Laos 1177 | LA: 1178 | address_template: *generic22 1179 | 1180 | # Lebanon 1181 | LB: 1182 | address_template: *generic2 1183 | postformat_replace: 1184 | # fix the postcode to make it nonbreaking space 1185 | - [" (\\d{4}) (\\d{4})\n", " $1 $2\n"] 1186 | # - ["\n(\\d{4}) (\\d{4}) ","\n$1 $2 "] 1187 | 1188 | # Saint Lucia 1189 | LC: 1190 | address_template: *generic17 1191 | 1192 | # Liechtenstein, same as Switzerland 1193 | LI: 1194 | use_country: CH 1195 | 1196 | # Sri Lanka 1197 | LK: 1198 | address_template: *generic20 1199 | 1200 | # Liberia 1201 | LR: 1202 | address_template: *generic1 1203 | 1204 | # Lesotho 1205 | LS: 1206 | address_template: *generic2 1207 | 1208 | # Lithuania 1209 | LT: 1210 | address_template: *generic1 1211 | 1212 | # Luxemburg 1213 | LU: 1214 | address_template: *generic3 1215 | 1216 | # Latvia 1217 | LV: 1218 | address_template: *generic7 1219 | 1220 | # Libya 1221 | LY: 1222 | address_template: *generic17 1223 | 1224 | # Morocco 1225 | MA: 1226 | address_template: *generic3 1227 | 1228 | # Monaco 1229 | MC: 1230 | address_template: *generic3 1231 | 1232 | # Moldova 1233 | MD: 1234 | address_template: | 1235 | {{{attention}}} 1236 | {{{house}}} 1237 | {{{road}}}, {{{house_number}}} 1238 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} 1239 | {{{country}}} 1240 | # Montenegro 1241 | ME: 1242 | address_template: *generic1 1243 | 1244 | # Collectivité de Saint-Martin 1245 | MF: 1246 | use_country: FR 1247 | change_country: France 1248 | 1249 | # Marshall Islands 1250 | MH: 1251 | use_country: US 1252 | add_component: state=Marshall Islands 1253 | 1254 | # Madagascar 1255 | MG: 1256 | address_template: | 1257 | {{{attention}}} 1258 | {{{house}}} 1259 | {{{house_number}}} {{{road}}} 1260 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1261 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1262 | {{{country}}} 1263 | # North Macedonia 1264 | MK: 1265 | address_template: *generic1 1266 | 1267 | # Mali 1268 | ML: 1269 | address_template: *generic17 1270 | 1271 | # Myanmar (Burma) 1272 | MM: 1273 | address_template: | 1274 | {{{attention}}} 1275 | {{{house}}} 1276 | {{{house_number}}} {{{road}}} 1277 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}}, {{{postcode}}} 1278 | {{{country}}} 1279 | # Mongolia 1280 | MN: 1281 | address_template: | 1282 | {{{attention}}} 1283 | {{{house}}} 1284 | {{{city_district}}} 1285 | {{#first}} {{{suburb}}} || {{{neighbourhood}}} {{/first}} 1286 | {{{road}}} 1287 | {{{house_number}}} 1288 | {{{postcode}}} 1289 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1290 | {{{country}}} 1291 | # Macau 1292 | MO: 1293 | address_template: | 1294 | {{{attention}}} 1295 | {{{house}}} 1296 | {{{road}}} {{{house_number}}} 1297 | {{#first}} {{{suburb}}} || {{{village}}} || {{{state_district}}} {{/first}} 1298 | {{{country}}} 1299 | # Macao - Portuguese 1300 | MO_pt: 1301 | address_template: | 1302 | {{{attention}}} 1303 | {{{house}}} 1304 | {{{road}}} {{{house_number}}} 1305 | {{#first}} {{{suburb}}} || {{{village}}} || {{{state_district}}} {{/first}} 1306 | {{{country}}} 1307 | # Macao - Chinese 1308 | MO_zh: 1309 | address_template: | 1310 | {{{country}}} 1311 | {{#first}} {{{suburb}}} || {{{village}}} || {{{state_district}}} {{/first}} 1312 | {{{road}}} 1313 | {{{house_number}}} 1314 | {{{house}}} 1315 | {{{attention}}} 1316 | # Northern Mariana Islands 1317 | MP: 1318 | use_country: US 1319 | change_country: United States of America 1320 | add_component: state=Northern Mariana Islands 1321 | 1322 | # Montserrat 1323 | MS: 1324 | address_template: *generic16 1325 | 1326 | # Malta 1327 | MT: 1328 | address_template: | 1329 | {{{attention}}} 1330 | {{{house}}} 1331 | {{{house_number}}} {{{road}}} 1332 | {{#first}} {{{city}}} || {{{town}}} || {{{suburb}}} || {{{village}}} {{/first}} 1333 | {{{postcode}}} 1334 | {{{country}}} 1335 | # Martinique - overseas territory of France (FR) 1336 | MQ: 1337 | use_country: FR 1338 | change_country: Martinique, France 1339 | 1340 | # Mauritania 1341 | MR: 1342 | address_template: *generic18 1343 | 1344 | # Mauritius 1345 | MU: 1346 | address_template: *generic18 1347 | 1348 | # Maldives 1349 | MV: 1350 | address_template: *generic2 1351 | 1352 | # Malawi 1353 | MW: 1354 | address_template: *generic16 1355 | 1356 | # Mexico 1357 | MX: 1358 | address_template: | 1359 | {{{attention}}} 1360 | {{{house}}} 1361 | {{{road}}} {{{house_number}}} 1362 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1363 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} 1364 | {{{country}}} 1365 | # Malaysia 1366 | MY: 1367 | address_template: | 1368 | {{{attention}}} 1369 | {{{house}}} 1370 | {{{house_number}}} {{{road}}} 1371 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1372 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1373 | {{{state}}} 1374 | {{{country}}} 1375 | # Mozambique 1376 | MZ: 1377 | address_template: *generic15 1378 | fallback_template: *fallback4 1379 | 1380 | # Namibia 1381 | NA: 1382 | address_template: *generic2 1383 | 1384 | # New Caledonia, special collectivity of France 1385 | NC: 1386 | use_country: FR 1387 | change_country: Nouvelle-Calédonie, France 1388 | 1389 | # Niger 1390 | NE: 1391 | address_template: | 1392 | {{{attention}}} 1393 | {{{house}}} 1394 | {{{house_number}}} 1395 | {{{road}}} 1396 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1397 | {{{country}}} 1398 | # Norfolk Island - same as Australia 1399 | NF: 1400 | use_country: AU 1401 | add_component: state=Norfolk Island 1402 | change_country: Australia 1403 | 1404 | # Nigeria 1405 | NG: 1406 | address_template: | 1407 | {{{attention}}} 1408 | {{{house}}} 1409 | {{{house_number}}} {{{road}}} 1410 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} {{{postcode}}} 1411 | {{{state}}} 1412 | {{{country}}} 1413 | # Nicaragua 1414 | NI: 1415 | address_template: *generic21 1416 | 1417 | # Netherlands 1418 | NL: 1419 | address_template: *generic1 1420 | postformat_replace: 1421 | # fix the postcode to make it \d\d\d\d \w\w 1422 | - ["\n(\\d{4})(\\w{2}) ", "\n$1 $2 "] 1423 | - ["\nKoninkrijk der Nederlanden$", "\nNederland"] 1424 | 1425 | # Norway 1426 | # quoted since python interprets it as a boolean. Silly python! 1427 | "NO": 1428 | address_template: *generic1 1429 | 1430 | # Nepal 1431 | NP: 1432 | address_template: | 1433 | {{{attention}}} 1434 | {{{house}}} 1435 | {{{road}}} {{{house_number}}} 1436 | {{#first}} {{{suburb}}} || {{{neighbourhood}}} || {{{city}}} {{/first}} 1437 | {{#first}} {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} {{{postcode}}} 1438 | {{{country}}} 1439 | # Nauru 1440 | NR: 1441 | address_template: *generic16 1442 | 1443 | # Niue 1444 | NU: 1445 | address_template: *generic16 1446 | 1447 | # New Zealand 1448 | NZ: 1449 | address_template: *generic20 1450 | 1451 | # Oman 1452 | OM: 1453 | address_template: | 1454 | {{{attention}}} 1455 | {{{house}}} 1456 | {{{house_number}}} {{{road}}} 1457 | {{{postcode}}} 1458 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} 1459 | {{{state}}} 1460 | {{{country}}} 1461 | # Panama 1462 | PA: 1463 | address_template: | 1464 | {{{attention}}} 1465 | {{{house}}} 1466 | {{{road}}} {{{house_number}}} 1467 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1468 | {{{postcode}}} 1469 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} 1470 | {{{state}}} 1471 | {{{country}}} 1472 | replace: 1473 | - ["city=Panama", "Panama City"] 1474 | - ["city=Panamá", "Ciudad de Panamá"] 1475 | 1476 | # Peru 1477 | PE: 1478 | address_template: *generic19 1479 | 1480 | # French Polynesia - same as FR 1481 | PF: 1482 | use_country: FR 1483 | change_country: Polynésie française, France 1484 | replace: 1485 | - [ 1486 | "Polynésie française, Îles du Vent \\(eaux territoriales\\)", 1487 | "Polynésie française", 1488 | ] 1489 | 1490 | # Papau New Guinea 1491 | PG: 1492 | address_template: | 1493 | {{{attention}}} 1494 | {{{house}}} 1495 | {{{house_number}}} {{{road}}} 1496 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} {{{postcode}}} {{{state}}} 1497 | {{{country}}} 1498 | # Philippines 1499 | PH: 1500 | address_template: | 1501 | {{{attention}}} 1502 | {{{house}}} 1503 | {{{house_number}}} {{{road}}} 1504 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{suburb}}} || {{{state_district}}} {{/first}} 1505 | {{{postcode}}} {{{state}}} 1506 | {{{country}}} 1507 | # Pakistan 1508 | PK: 1509 | address_template: | 1510 | {{{attention}}} 1511 | {{{house}}} 1512 | {{{house_number}}} {{{road}}} 1513 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1514 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} {{{postcode}}} 1515 | {{{country}}} 1516 | # Poland 1517 | PL: 1518 | address_template: *generic1 1519 | postformat_replace: 1520 | # fix the postcode to make it \d\d-\d\d\d 1521 | - ["\n(\\d{2})(\\w{3}) ", "\n$1-$2 "] 1522 | 1523 | # Saint Pierre and Miquelon - same as FR 1524 | PM: 1525 | use_country: FR 1526 | change_country: Saint-Pierre-et-Miquelon, France 1527 | 1528 | # Pitcairn Islands 1529 | PN: 1530 | address_template: | 1531 | {{{attention}}} 1532 | {{{house}}} 1533 | {{#first}} {{{city}}} || {{{town}}} || {{{island}}} {{/first}} 1534 | {{{country}}} 1535 | # Puerto Rico, same as USA 1536 | PR: 1537 | use_country: US 1538 | change_country: United States of America 1539 | add_component: state=Puerto Rico 1540 | 1541 | # Palestine 1542 | PS: 1543 | use_country: IL 1544 | 1545 | # Portugal 1546 | PT: 1547 | address_template: *generic1 1548 | 1549 | # Palau 1550 | PW: 1551 | address_template: *generic1 1552 | 1553 | # Parguay 1554 | PY: 1555 | address_template: *generic1 1556 | 1557 | # Qatar 1558 | QA: 1559 | address_template: *generic17 1560 | 1561 | # Réunion - same as FR 1562 | RE: 1563 | use_country: FR 1564 | change_country: La Réunion, France 1565 | 1566 | # Romania 1567 | RO: 1568 | address_template: *generic1 1569 | 1570 | # Serbia 1571 | RS: 1572 | address_template: *generic1 1573 | 1574 | # Russia 1575 | RU: 1576 | address_template: *generic10 1577 | fallback_template: | 1578 | {{{attention}}} 1579 | {{{house}}} 1580 | {{{road}}} {{{house_number}}} 1581 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{island}}} || {{{village}}} {{/first}} 1582 | {{#first}} {{{city}}} || {{{town}}} || {{{municipality}}} {{/first}} 1583 | {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} 1584 | {{{country}}} 1585 | # Rwanda 1586 | RW: 1587 | address_template: *generic16 1588 | 1589 | # Saudi Arabia 1590 | SA: 1591 | address_template: | 1592 | {{{attention}}} 1593 | {{{house}}} 1594 | {{{house_number}}} {{{road}}}, {{#first}} {{{village}}} || {{{city_district}}} || {{{suburb}}} || {{{neighbourhood}}} {{/first}} 1595 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} {{/first}} {{{postcode}}} 1596 | {{{country}}} 1597 | # Solomon Islands 1598 | SB: 1599 | address_template: *generic17 1600 | 1601 | # Seychelles 1602 | SC: 1603 | address_template: | 1604 | {{{attention}}} 1605 | {{{house}}} 1606 | {{{house_number}}} {{{road}}} 1607 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{island}}} {{/first}} 1608 | {{{island}}} 1609 | {{{country}}} 1610 | # Sudan 1611 | SD: 1612 | address_template: *generic1 1613 | 1614 | # Sweden 1615 | SE: 1616 | address_template: *generic1 1617 | postformat_replace: 1618 | # fix the postcode to make it \d\d\d \d\d 1619 | - ["\n(\\d{3})(\\d{2}) ", "\n$1 $2 "] 1620 | 1621 | # Singapore 1622 | SG: 1623 | address_template: *generic2 1624 | 1625 | # Saint Helena, Ascension and Tristan da Cunha - same as UK 1626 | SH: 1627 | use_country: GB 1628 | change_country: $state, United Kingdom 1629 | 1630 | # Slovenia 1631 | SI: 1632 | address_template: *generic1 1633 | 1634 | # Svalbard and Jan Mayen - same as Norway 1635 | SJ: 1636 | use_country: "NO" 1637 | change_country: Norway 1638 | 1639 | # Slovakia 1640 | SK: 1641 | address_template: *generic1 1642 | replace: 1643 | - ["^District of ", ""] 1644 | 1645 | # Sierra Leone 1646 | SL: 1647 | address_template: *generic16 1648 | 1649 | # San Marino - same as IT 1650 | SM: 1651 | use_country: IT 1652 | 1653 | # Senegal 1654 | SN: 1655 | address_template: *generic3 1656 | 1657 | # Somalia 1658 | SO: 1659 | address_template: *generic21 1660 | 1661 | # Suriname 1662 | SR: 1663 | address_template: *generic21 1664 | 1665 | # South Sudan 1666 | SS: 1667 | address_template: *generic17 1668 | 1669 | # São Tomé and Príncipe 1670 | ST: 1671 | address_template: *generic17 1672 | 1673 | # El Salvador 1674 | SV: 1675 | address_template: | 1676 | {{{attention}}} 1677 | {{{house}}} 1678 | {{{road}}} {{{house_number}}} 1679 | {{{postcode}}} - {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1680 | {{{state}}} 1681 | {{{country}}} 1682 | postformat_replace: 1683 | - ["\n- ", "\n "] 1684 | 1685 | # Sint Maarten 1686 | SX: 1687 | address_template: *generic17 1688 | 1689 | # Syria 1690 | SY: 1691 | address_template: | 1692 | {{{attention}}} 1693 | {{{house}}} 1694 | {{{road}}}, {{{house_number}}} 1695 | {{#first}} {{{village}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{suburb}}} {{/first}} 1696 | {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{state}}} {{/first}} 1697 | 1698 | {{{country}}} 1699 | # Swaziland 1700 | SZ: 1701 | address_template: | 1702 | {{{attention}}} 1703 | {{{house}}} 1704 | {{{road}}} {{{house_number}}} 1705 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} 1706 | {{{postcode}}} 1707 | {{{country}}} 1708 | # Turks and Caicos Islands - same as UK 1709 | TC: 1710 | use_country: GB 1711 | 1712 | # Chad 1713 | TD: 1714 | address_template: *generic21 1715 | 1716 | # French Southern and Antarctic Lands 1717 | TF: 1718 | use_country: FR 1719 | change_country: Terres australes et antarctiques françaises, France 1720 | 1721 | # Togo 1722 | TG: 1723 | address_template: *generic18 1724 | 1725 | # Thailand 1726 | TH: 1727 | address_template: | 1728 | {{{attention}}} 1729 | {{{house}}} 1730 | {{{house_number}}} {{{village}}} 1731 | {{{road}}} 1732 | {{#first}} {{{neighbourhood}}} || {{{city}}} || {{{town}}} {{/first}}, {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 1733 | {{{state}}} {{{postcode}}} 1734 | {{{country}}} 1735 | # Tajikistan 1736 | TJ: 1737 | address_template: *generic1 1738 | 1739 | # Tokelau, territory of New Zealand 1740 | TK: 1741 | use_country: NZ 1742 | change_country: Tokelau, New Zealand 1743 | 1744 | # Timor-Leste/East Timor 1745 | TL: 1746 | address_template: *generic17 1747 | 1748 | # Turkmenistan 1749 | TM: 1750 | address_template: *generic22 1751 | 1752 | # Tunisia 1753 | TN: 1754 | address_template: *generic3 1755 | 1756 | # Tonga 1757 | TO: 1758 | address_template: *generic16 1759 | 1760 | # Turkey 1761 | TR: 1762 | address_template: *generic1 1763 | 1764 | # Trinidad and Tobago 1765 | TT: 1766 | address_template: | 1767 | {{{attention}}} 1768 | {{{house}}} 1769 | {{{house_number}}} {{{road}}} 1770 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 1771 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}}, {{{postcode}}} 1772 | {{{country}}} 1773 | # Tuvalu 1774 | TV: 1775 | address_template: | 1776 | {{{attention}}} 1777 | {{{house}}} 1778 | {{{house_number}}} {{{road}}} 1779 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 1780 | {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} || {{{island}}} {{/first}} 1781 | {{{country}}} 1782 | # Taiwan 1783 | TW: 1784 | address_template: *generic20 1785 | 1786 | TW_en: 1787 | address_template: *generic20 1788 | 1789 | TW_zh: 1790 | address_template: | 1791 | {{{country}}} 1792 | {{{postcode}}} 1793 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} {{/first}} 1794 | {{{city_district}}} 1795 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} 1796 | {{{road}}} 1797 | {{{house_number}}} 1798 | {{{house}}} 1799 | {{{attention}}} 1800 | # Tanzania 1801 | TZ: 1802 | address_template: *generic14 1803 | fallback_template: *generic14 1804 | postformat_replace: 1805 | - ["Dar es Salaam\nDar es Salaam", "Dar es Salaam"] 1806 | 1807 | # Ukraine 1808 | UA: 1809 | address_template: | 1810 | {{{attention}}} 1811 | {{{house}}} 1812 | {{{road}}}, {{{house_number}}} 1813 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 1814 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} || {{{state}}} {{/first}} 1815 | {{{postcode}}} 1816 | {{{country}}} 1817 | # Uganda 1818 | UG: 1819 | address_template: *generic16 1820 | 1821 | # US Minor Outlying Islands, same as USA 1822 | UM: 1823 | fallback_template: *fallback2 1824 | use_country: US 1825 | change_country: United States of America 1826 | add_component: state=US Minor Outlying Islands 1827 | 1828 | # USA 1829 | US: 1830 | address_template: *generic4 1831 | fallback_template: *fallback2 1832 | replace: 1833 | - ["state=United States Virgin Islands", "US Virgin Islands"] 1834 | - ["state=USVI", "US Virgin Islands"] 1835 | postformat_replace: 1836 | - ["\nUS$", "\nUnited States of America"] 1837 | - ["\nUSA$", "\nUnited States of America"] 1838 | - ["\nUnited States$", "\nUnited States of America"] 1839 | 1840 | # Uzbekistan 1841 | UZ: 1842 | address_template: | 1843 | {{{attention}}} 1844 | {{{house}}} 1845 | {{{road}}} {{{house_number}}} 1846 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}} 1847 | {{#first}} {{{state}}} || {{{state_district}}} {{/first}} 1848 | {{{country}}} 1849 | {{{postcode}}} 1850 | # Uruguay 1851 | UY: 1852 | address_template: *generic1 1853 | 1854 | # Vatican City - same as IT 1855 | VA: 1856 | use_country: IT 1857 | 1858 | # Saint Vincent and the Grenadines 1859 | VC: 1860 | address_template: *generic17 1861 | 1862 | # Venezuela 1863 | VE: 1864 | address_template: | 1865 | {{{attention}}} 1866 | {{{house}}} 1867 | {{{road}}} {{{house_number}}} 1868 | {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} {{{postcode}}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} 1869 | {{{country}}} 1870 | # British Virgin Islands 1871 | VG: 1872 | address_template: | 1873 | {{{attention}}} 1874 | {{{house}}} 1875 | {{{house_number}}} {{{road}}} 1876 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} {{/first}}, {{{island}}} 1877 | {{{country}}}, {{{postcode}}} 1878 | # US Virgin Islands, same as USA 1879 | VI: 1880 | use_country: US 1881 | change_country: United States of America 1882 | add_component: state=US Virgin Islands 1883 | 1884 | # Vietnam 1885 | VN: 1886 | address_template: | 1887 | {{{attention}}} 1888 | {{{house}}} 1889 | {{{house_number}}}, {{{road}}} 1890 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} {{/first}} 1891 | {{{state}}} {{{postcode}}} 1892 | {{{country}}} 1893 | # Vanuatu 1894 | VU: 1895 | address_template: *generic17 1896 | 1897 | # Wallis and Futuna, same as France 1898 | WF: 1899 | use_country: FR 1900 | change_country: Wallis-et-Futuna, France 1901 | 1902 | # Samoa 1903 | WS: 1904 | address_template: *generic17 1905 | 1906 | # Yemen 1907 | YE: 1908 | address_template: *generic18 1909 | 1910 | # Mayotte - same as FR 1911 | YT: 1912 | use_country: FR 1913 | change_country: Mayotte, France 1914 | 1915 | # South Africa 1916 | ZA: 1917 | address_template: | 1918 | {{{attention}}} 1919 | {{{house}}} 1920 | {{{house_number}}} {{{road}}} 1921 | {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}} 1922 | {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}} 1923 | {{{postcode}}} 1924 | {{{country}}} 1925 | # Zambia 1926 | ZM: 1927 | address_template: *generic3 1928 | 1929 | # Zimbabwe 1930 | ZW: 1931 | address_template: *generic16 1932 | --------------------------------------------------------------------------------