|
1 | 1 | pyPostcode |
2 | 2 | ========== |
3 | 3 |
|
4 | | -Python wrapper for the API of postcodeapi.nu |
| 4 | +##Introduction |
| 5 | + |
| 6 | +This is a Python library to request information from the PostcodeApi.nu API. |
| 7 | +This API allows you to search for Dutch addresses using zipcodes. |
| 8 | + |
| 9 | +For more information about this API, please visit http://postcodeapi.nu |
| 10 | + |
| 11 | + |
| 12 | +##Installation |
| 13 | + |
| 14 | +###Manually |
| 15 | + |
| 16 | +pyPostcode consists of a single file (pyPostcode.py) that you can put in your python search path or in site-packages (or dist-packages depending on the platform) |
| 17 | +You can also simply run it by putting it in the same directory as you main script file or start a python interpreter in the same directory. |
| 18 | +pyPostcode works with Python 2.7.x (you're welcome to test other versions) |
| 19 | + |
| 20 | +###API-key |
| 21 | + |
| 22 | +The API can only be used when you have your own API-key. |
| 23 | +You can request this key by visiting: http://www.postcodeapi.nu/#request |
| 24 | + |
| 25 | + |
| 26 | +##Example |
| 27 | + |
| 28 | +###Basic usage |
| 29 | + |
| 30 | +Get the address by using the zipcode and the house number |
| 31 | + |
| 32 | +```python |
| 33 | +#!/usr/bin/python |
| 34 | + |
| 35 | +from pyPostcode import pyPostcodeApi |
| 36 | + |
| 37 | +postcodeapi = pyPostcodeApi('{YOUR_API_KEY}') # Set your own API-key |
| 38 | +result = postcodeapi.getaddress('1011AC', 154) # use address search |
| 39 | +print result.street, result.house_number, result.town |
| 40 | +``` |
| 41 | + |
| 42 | +###Result data |
| 43 | + |
| 44 | +the following information can be gathered from the result: |
| 45 | + |
| 46 | +* street |
| 47 | +* house_number |
| 48 | +* postcode |
| 49 | +* town |
| 50 | +* municipality |
| 51 | +* province |
| 52 | +* latitude |
| 53 | +* longitude |
| 54 | +* x ([Rijksdriehoek]/[Trigonometrical] coordinate) |
| 55 | +* y ([Rijksdriehoek]/[Trigonometrical] coordinate) |
| 56 | + |
| 57 | +##License |
| 58 | + |
| 59 | +"PostcodeApi" is owned by freshheads, see http://postcodeapi.nu and http://freshheads.com for more information. |
| 60 | +I am in no way affiliated with PostcodeAPI or the freasheads organization. |
| 61 | + |
| 62 | +[Rijksdriehoek]: http://nl.wikipedia.org/wiki/Rijksdriehoekscoördinaten |
| 63 | +[Trigonometrical]: http://en.wikipedia.org/wiki/Triangulation_station |
| 64 | + |
0 commit comments