Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marians/agssearch
Python client for the German Destatis Gemeindeverzeichnis
https://github.com/marians/agssearch
Last synced: 27 days ago
JSON representation
Python client for the German Destatis Gemeindeverzeichnis
- Host: GitHub
- URL: https://github.com/marians/agssearch
- Owner: marians
- Created: 2013-04-21T09:43:05.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-26T12:45:27.000Z (almost 11 years ago)
- Last Synced: 2024-09-06T14:54:43.010Z (2 months ago)
- Language: Python
- Size: 152 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
agssearch
=========Python client for the official German directory of cities by DeStatis, called "[Gemeindeverzeichnis](https://www.destatis.de/gv/)". Allows you to look up the official city key ("Amtlicher Gemeindeschluessel", in brief: AGS) for a city name and vice versa.
Note that the AGS is still in common use, but to be replaced by the "Regionalschluessel" (RS). Read more in the German Wikipedia page [Amtlicher Gemeindeschluessel](http://de.wikipedia.org/wiki/Amtlicher_Gemeindeschl%C3%BCssel).
## Install
pip install agssearch
## Use in your code
### Finding the AGS for a city:
```python
>>> import agssearch.agssearch as ags
>>> result = ags.search("Bonn")
>>> for r in result:
>>> print r['ags'], r['name']05314000 Stadt Bonn
08337022 VVG der Stadt Bonndorf im Schwarzwald
08337022 Stadt Bonndorf im Schwarzwald
```### Look up an AGS:
```python
>>> import agssearch.agssearch as ags
>>> result = ags.lookup("05314000")
>>> if result is not None:
>>> print result['ags'], result['name']05314000 Stadt Bonn
```## Use as command line client
$ agssearch Bonn
[05314000] Stadt Bonn, Bonn, Stadt, Nordrhein-Westfalen
[08337022] VVG der Stadt Bonndorf im Schwarzwald, Waldshut, Baden-Wuerttemberg
[08337022] Stadt Bonndorf im Schwarzwald, Waldshut, Baden-Wuerttemberg$ agssearch 05314000
[05314000] Stadt Bonn, Bonn, Stadt, Nordrhein-Westfalen## Like agssearch?
Feel free to [tip me](https://www.gittip.com/marians/)!