Skip to main content

Look up information about Icelandic street addresses and postcodes

Project description

iceaddr

Look up Icelandic street addresses and postcodes

Python module to look up and get information about Icelandic street addresses and postcodes. The underlying data is taken from Staðfangaskrá (the National Icelandic Address Registry) maintained by Registers Iceland (CC-BY).

Examples

Look up address with postcode:

>>> from iceaddr import iceaddr_lookup
>>> a = iceaddr_lookup('Öldugata', number=4, postcode=101)
>>> pprint.PrettyPrinter().pprint(a)
[{'bokst': '',
  'byggd': 1,
  'heiti_nf': 'Öldugata',
  'heiti_tgf': 'Öldugötu',
  'hnitnum': 10017023,
  'husnr': 4,
  'landnr': 100570,
  'lat_wgs84': 64.1484874806941,
  'long_wgs84': -21.9452072913341,
  'postnr': 101,
  'serheiti': '',
  'stadur_nf': 'Reykjavík',
  'stadur_tgf': 'Reykjavík',
  'svaedi': 'Höfuðborgarsvæðið',
  'svfnr': 0,
  'tegund': 'Þéttbýli',
  'vidsk': '',
  'x_isn93': 356699.479545455,
  'y_isn93': 408411.468181818}]

Look up address with placename

>>> from iceaddr import iceaddr_lookup
>>> a = iceaddr_lookup('Öldugötu', number=4, placename='Reykjavík')
>>> pprint.PrettyPrinter().pprint(a)
[{'bokst': '',
  'byggd': 1,
  'heiti_nf': 'Öldugata',
  'heiti_tgf': 'Öldugötu',
  'hnitnum': 10017023,
  'husnr': 4,
  'landnr': 100570,
  'lat_wgs84': 64.1484874806941,
  'long_wgs84': -21.9452072913341,
  'postnr': 101,
  'serheiti': '',
  'stadur_nf': 'Reykjavík',
  'stadur_tgf': 'Reykjavík',
  'svaedi': 'Höfuðborgarsvæðið',
  'svfnr': 0,
  'tegund': 'Þéttbýli',
  'vidsk': '',
  'x_isn93': 356699.479545455,
  'y_isn93': 408411.468181818}]

Street names and place names can be provided in either nominative or dative case (e.g. both 'Öldugata' and 'Öldugötu' will work, as will both 'Selfoss' and 'Selfossi').

Keys

Key
bokst House letter
byggd
heiti_nf Street name (nominative case), e.g. 'Öldugata'
heiti_tgf Street name (dative case), e.g. 'Öldugötu'
hnitnum
husnr House number
landnr
lat_wgs84 Latitude (WGS84 coordinates)
long_wgs84 Longtitude (WGS84 coordinates)
postnr Postcode (e.g. 101)
serheiti Special name
stadur_nf Placename (nominative case), e.g. 'Selfoss'
stadur_tgf Placename (dative case), e.g. 'Selfossi'
svaedi Area (e.g. 'Höfuðborgarsvæðið', 'Norðurland')
svfnr
tegund Postcode (e.g. 101)
vidsk Additional information
x_isn93 Coordinate X (ISN93)
y_isn93 Coordinate Y (ISN93)

Postcodes

>>> from iceaddr import postcodes_for_placename
>>> postcodes_for_placename('Kópavogur')
[200, 201, 202, 203]
>>> from iceaddr import postcodes
>>> postcodes[401]
{   'area': 'Vesturland og Vestfirðir', 
    'placename_nf': 'Ísafjörður', 
    'placename_tgf': 'Ísafirði', 
    'type': 'Dreifbýli' }

BSD License

Copyright (C) 2018 Sveinbjorn Thordarson

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iceaddr-0.1.2.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

iceaddr-0.1.2-py3-none-any.whl (5.5 MB view details)

Uploaded Python 3

File details

Details for the file iceaddr-0.1.2.tar.gz.

File metadata

  • Download URL: iceaddr-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for iceaddr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 647f7de10852e6d3af1f0a14c13b03d18f9607b583d74ab47855485817395043
MD5 7a8bdb95cdac29602c4d1c9c28db2be8
BLAKE2b-256 7bddb59acaa702cc4684ca6c165a78610c6218efa7857025c024b0ebd3bf23ff

See more details on using hashes here.

File details

Details for the file iceaddr-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: iceaddr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for iceaddr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1221dc51ab60d33c7cc60ce5854bdb743c58b8040e6cb735668d9294fe6ef95a
MD5 0e2c05df46aa8f3353d7f3f026cf3582
BLAKE2b-256 22b6fda73e2e0dddce058167625915c7fa87f215a645f2f6e1383dfed9436c76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page