Skip to main content

Python client for the German Destatis Gemeindeverzeichnis

Project description

Python client for the official German directory of cities by DeStatis, called “Gemeindeverzeichnis“. 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.

Install

pip install agssearch

Use in your code

Finding the AGS for a city:

>>> 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:

>>> 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!

Project details


Download files

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

Source Distributions

agssearch-0.4.zip (5.2 kB view details)

Uploaded Source

agssearch-0.4.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file agssearch-0.4.zip.

File metadata

  • Download URL: agssearch-0.4.zip
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for agssearch-0.4.zip
Algorithm Hash digest
SHA256 8ef04850fd4acdb504d62018e8d5d5f1415819ae163038abe9fb9c617c588b29
MD5 4efce45447b6cd310558c0791cef317b
BLAKE2b-256 22b2e57bc78af3f982fb7ba9212503f2694d68386a2639bebba7e4df6639e9e0

See more details on using hashes here.

File details

Details for the file agssearch-0.4.tar.gz.

File metadata

  • Download URL: agssearch-0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for agssearch-0.4.tar.gz
Algorithm Hash digest
SHA256 bd456d4c54b47b8006386f6204dbf5d45f5cdddb0adeda546f3cee8e8a1d2399
MD5 0f8a908b721f5cd66817120afce255e6
BLAKE2b-256 89703b02e1827921f822bdfa76b37523236badeedb2bc5b2c59b446063dd11db

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