Metadata-Version: 2.4
Name: geonames_postcode
Version: 0.3
Summary: geonames_postcode is a Python package to make geonames.org postcode databases accessible in Python. It provides a command line tool to fetch, preprocess, and store the data in a Python file per country. In the result very fast (in-memory) queries by postcodes and names are available using just a few MB per country. Some helper functions are part of the package to solve common tasks like getting distances and finding postcodes nearby.
Author-email: André Wobst <project.geonames_postcode@wobsta.de>
License-Expression: GPL-2.0-or-later
Project-URL: Homepage, https://github.com/wobsta/geonames_postcode
Project-URL: Documentation, https://geonames-postcode.readthedocs.io/
Project-URL: Repository, https://github.com/wobsta/geonames_postcode
Project-URL: Changelog, https://github.com/wobsta/geonames_postcode/blob/master/CHANGES
Project-URL: Issues, https://github.com/wobsta/geonames_postcode/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: sphinx; extra == "dev"
Dynamic: license-file

geonames_postcode
=================

geonames_postcode is a Python package to make geonames.org postcode
databases accessible in Python. It provides a command line tool to
fetch, preprocess, and store the data in a Python file per country.
In the result very fast (in-memory) queries by postcodes and names are
available using just a few MB per country. Some helper functions are
part of the package to solve common tasks like getting distances and
finding postcodes nearby.

Quickstart
----------

**Please respect the license of the geonames.org data (Creative Commons
Attribution 4.0 License), see geonames.org for details.**

On the console::

    pip install geonames_postcode
    geonames_postcode_fetch DE

In Python::

    >>> import geonames_postcode
    >>> latlong1 = geonames_postcode.coordinates('DE', 'Unterschleißheim')
    >>> latlong1
    (48.2804, 11.5768)
    >>> latlong2 = geonames_postcode.coordinates('DE', 'München')
    >>> geonames_postcode.distance(*latlong1, *latlong2)
    15.289746063637923
    >>> geonames_postcode.nearby_postcodes('DE', *latlong1, 5)
    ['85386', '85716', '85764', '85778']
    >>> geonames_postcode.postcode_names('DE', '85764')
    ['Oberschleißheim']
    >>> geonames_postcode.name_autocomplete('DE', 'Münche')
    ['München', 'Müncheberg', 'Münchehofe', 'Münchenbernsdorf']

Usage
-----

see https://geonames-postcode.readthedocs.io/

License
-------

The project is licensed under the GPLv2+.

