geopy/geopy — pull request #54 by kpanic (2014-06-22 15:16:40+00:00)
Title: Add to osm structured query support

This PR seems to fit my use case.

From a given **zipcode** I want to know the **city_district**
Structured OSM queries through `Nominatim` class seems to do the job.

**NOTE**: Sorry for poorly testing the functionality in this PR, but it seems that also other tests are broken, and (I guess) it's quite difficult to test the lookup behaviour without mocking and/or hiding the real integration test.

**Example:**

```
from geopy import Nominatim
geoloc = Nominatim(country_bias='DE')
geoloc.geocode({'postalcode': 10117}, addressdetails=True).raw['address']['city_district']
u'Mitte'
```

or, more fine grained:

```
In [15]: geoloc.geocode({'postalcode': 10969}, addressdetails=True).raw['address']['city_district']
Out[15]: u'Friedrichshain-Kreuzberg'
In [14]: geoloc.geocode({'postalcode': 10969}, addressdetails=True).raw['address']['suburb']
Out[14]: u'Kreuzberg'
```