{"id":22938206,"url":"https://github.com/hootnot/postcode-api-wrapper","last_synced_at":"2025-08-12T18:32:36.996Z","repository":{"id":23469049,"uuid":"26833389","full_name":"hootnot/postcode-api-wrapper","owner":"hootnot","description":"API Wrapper for the REST API of Postcode.nl","archived":false,"fork":false,"pushed_at":"2024-01-14T22:15:44.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-15T01:03:54.302Z","etag":null,"topics":["api-wrapper","django-postcodepy-proxy","postcode","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hootnot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-11-18T22:35:13.000Z","updated_at":"2023-12-05T14:15:42.000Z","dependencies_parsed_at":"2024-01-14T23:30:22.736Z","dependency_job_id":"77ebbb59-5565-4450-87e6-7a5cef3335da","html_url":"https://github.com/hootnot/postcode-api-wrapper","commit_stats":{"total_commits":88,"total_committers":3,"mean_commits":"29.333333333333332","dds":"0.10227272727272729","last_synced_commit":"42359cb9402f84a06f7d58f889f1156d653f5ea9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2Fpostcode-api-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2Fpostcode-api-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2Fpostcode-api-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2Fpostcode-api-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hootnot","download_url":"https://codeload.github.com/hootnot/postcode-api-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228886856,"owners_count":17986899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","django-postcodepy-proxy","postcode","python"],"created_at":"2024-12-14T12:16:28.090Z","updated_at":"2024-12-14T12:16:28.584Z","avatar_url":"https://github.com/hootnot.png","language":"Python","readme":"\npostcode-api-wrapper\n====================\n\n[![Build Status](https://travis-ci.org/hootnot/postcode-api-wrapper.svg?branch=master)](https://travis-ci.org/hootnot/postcode-api-wrapper)\n[![Documentation Status](http://readthedocs.org/projects/postcode-api-wrapper/badge/?version=latest)](http://postcode-api-wrapper.readthedocs.org/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/postcodepy.svg)](http://badge.fury.io/py/postcodepy)\n[![Code Health](https://landscape.io/github/hootnot/postcode-api-wrapper/master/landscape.svg?style=flat)](https://landscape.io/github/hootnot/postcode-api-wrapper/master)\n[![Coverage Status](https://coveralls.io/repos/github/hootnot/postcode-api-wrapper/badge.svg?branch=master)](https://coveralls.io/github/hootnot/postcode-api-wrapper?branch=master)\n\nAPI Wrapper for the API of Postcode.nl\n\n---\n\nInstall\n========\nThis module is also installable using **pip**\n\n        $ sudo pip install postcodepy\n\n\nAbout\n==========\n\nThis module is handy to be used in web applications to autocomplete address information. There is also an\nendpoint for information validation, enrichment and fraud risk check. See the docs for details.\n\nAs it comes, it is specific for the Netherlands. So in Dutch:\n\n## ... in Dutch ...\nDeze module is handig om in web-applicaties te gebruiken om op basis van postcode en huisnummer eenvoudig complete adres informatie op te kunnen vragen.\n\nDe API van postcode.nl wordt hiervoor gebruikt. Op [https://api.postcode.nl](https://api.postcode.nl) kunt u zich registreren voor het gebruik van deze API en daarmee de beschikking krijgen over een 'secret' en een 'key' die benodigd zijn om deze API te kunnen gebruiken.\n\nDe Signaal-API kan worden gebruikt voor validatie, controle en verrijking van transactie- en klantgegevens.\n\nAuthentication\n==============\nIf you want to use this module or you want to run the tests you *need* to have\nan **access_key** and a **access_secret**. \n\nExample\n===========\n\n    import os\n    import sys\n    import json\n    import postcodepy\n\n    access_key = os.getenv(\"ACCESS_KEY\")\n    access_secret = os.getenv(\"ACCESS_SECRET\")\n    # get your access key and secret at https://api.postcode.nl\n\n    \"\"\"First and third are OK, the 2nd is not OK and raises an Exception\n         the exception is written to stderr\n    \"\"\"\n    api = postcodepy.API(environment='live',\n                         access_key=access_key, access_secret=access_secret)\n\n    # exit program if one of these exceptions occurs\n    fatals = [\n        'PostcodeNl_Controller_Plugin_HttpBasicAuthentication_NotAuthorizedException',\n        'PostcodeNl_Controller_Plugin_HttpBasicAuthentication_PasswordNotCorrectException'\n    ]\n\n    # 2nd and last should fail\n    for pc in [('1071XX', 1),\n               ('1077XX', 1),\n               ('7514BP', 129),\n               ('7514BP', 129, 'A'),\n               ('7514BP', 129, 'B')]:\n        try:\n            retValue = api.get_postcodedata(*pc)\n            print(\"\\nresults for: {}\".format(str(pc)))\n            print(json.dumps(retValue, sort_keys=True, indent=2))\n\n        except postcodepy.PostcodeError as e:\n            if e.exceptionId in fatals:\n                sys.stderr.write(\"Exiting on fatal exception: {} [{}]\".\n                                 format(e.exceptionId, e.msg))\n                sys.exit(2)\n            else:\n                sys.stderr.write(\"---------------------------\\n\")\n                sys.stderr.write(\"{}\\n\".format(str(pc)))\n                sys.stderr.write(\"{}\\n\".format(e.exceptionId))\n                sys.stderr.write(\"{}\\n\".format(json.dumps(\n                      e.response_data, sort_keys=True, indent=2))\n                )\n\n## Output\n\nRunning the script above will give you this JSON output and the exception on stderr\n\n    results for: ('1071XX', 1)\n    {\n      \"addressType\": \"building\", \n      \"bagAddressableObjectId\": \"0363010012073352\", \n      \"bagNumberDesignationId\": \"0363200012073684\", \n      \"city\": \"Amsterdam\", \n      \"houseNumber\": 1, \n      \"houseNumberAddition\": \"\", \n      \"houseNumberAdditions\": [\n        \"\"\n      ], \n      \"latitude\": 52.35994439, \n      \"longitude\": 4.88538896, \n      \"municipality\": \"Amsterdam\", \n      \"postcode\": \"1071XX\", \n      \"province\": \"Noord-Holland\", \n      \"purposes\": [\n        \"assembly\"\n      ], \n      \"rdX\": 120816, \n      \"rdY\": 485901, \n      \"street\": \"Museumstraat\", \n      \"surfaceArea\": 38149\n    }\n    \n    results for: ('7514BP', 129)\n    {\n      \"addressType\": \"building\", \n      \"bagAddressableObjectId\": \"0153010000345343\", \n      \"bagNumberDesignationId\": \"0153200000345342\", \n      \"city\": \"Enschede\", \n      \"houseNumber\": 129, \n      \"houseNumberAddition\": \"\", \n      \"houseNumberAdditions\": [\n        \"\", \n        \"A\"\n      ], \n      \"latitude\": 52.22770127, \n      \"longitude\": 6.89701549, \n      \"municipality\": \"Enschede\", \n      \"postcode\": \"7514BP\", \n      \"province\": \"Overijssel\", \n      \"purposes\": [\n        \"assembly\"\n      ], \n      \"rdX\": 258149, \n      \"rdY\": 472143, \n      \"street\": \"Lasondersingel\", \n      \"surfaceArea\": 6700\n    }\n    \n    results for: ('7514BP', 129, 'A')\n    {\n      \"addressType\": \"building\", \n      \"bagAddressableObjectId\": \"0153010000329929\", \n      \"bagNumberDesignationId\": \"0153200000329928\", \n      \"city\": \"Enschede\", \n      \"houseNumber\": 129, \n      \"houseNumberAddition\": \"A\", \n      \"houseNumberAdditions\": [\n        \"\", \n        \"A\"\n      ], \n      \"latitude\": 52.22770127, \n      \"longitude\": 6.89701549, \n      \"municipality\": \"Enschede\", \n      \"postcode\": \"7514BP\", \n      \"province\": \"Overijssel\", \n      \"purposes\": [\n        \"residency\"\n      ], \n      \"rdX\": 258149, \n      \"rdY\": 472143, \n      \"street\": \"Lasondersingel\", \n      \"surfaceArea\": 119\n    }\n\n## The exception of the 2nd postcode and last\n\n    ---------------------------\n    ('1077XX', 1)\n    PostcodeNl_Service_PostcodeAddress_AddressNotFoundException\n    {\n      \"exception\": \"Combination does not exist.\", \n      \"exceptionId\": \"PostcodeNl_Service_PostcodeAddress_AddressNotFoundException\"\n    }\n    ---------------------------\n    ('7514BP', 129, 'B')\n    ERRHouseNumberAdditionInvalid\n    {\n      \"exception\": \"Invalid housenumber addition: 'None'\", \n      \"exceptionId\": \"ERRHouseNumberAdditionInvalid\", \n      \"validHouseNumberAdditions\": [\n        \"\", \n        \"A\"\n      ]\n    }\n\n\nSignal API example\n==================\n\n      access_key=\"...\"\n      access_secret=\"...\"\n      # get your access key and secret at https://api.postcode.nl\n      \n      from postcodepy import postcodepy \n\n      import os, sys\n      import json\n\n      \"\"\" TEST: signal check URL, a request that should report 1 warning, with 6 signals\n      \"\"\"\n      api = postcodepy.API( environment='live', access_key=access_key, access_secret=access_secret)\n\n      retValue = None\n      try:\n          dct = { \"customer\": {\n                                   \"email\": \"test-address@postcode.nl\",\n                             \"phoneNumber\": \"+31235325689\",\n                                 \"address\": {\n                                                \"postcode\": \"2012ES\",\n                                             \"houseNumber\": \"30\",\n                                                 \"country\": \"NL\"\n                                            }\n                              },\n               \"transaction\": {\n                              \"internalId\": \"MyID-249084\",\n                         \"deliveryAddress\": {\n                                             \"postcode\": \"2012ES\",\n                                          \"houseNumber\": \"99\",\n                                              \"country\": \"NL\"\n                                            }\n                              }\n                 }\n          \n          retValue = api.get_signalcheck( dct )\n          print(json.dumps(retValue, indent=4))\n\n      except postcodepy.PostcodeError as e:\n          sys.stderr.write(\"{}, {}, {}\".format(e, e.exceptionId,\n                                               json.dumps(e.response_data, sort_keys=True, indent=2))\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhootnot%2Fpostcode-api-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhootnot%2Fpostcode-api-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhootnot%2Fpostcode-api-wrapper/lists"}