https://github.com/johanmeiring/python-poco
https://github.com/johanmeiring/python-poco
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/johanmeiring/python-poco
- Owner: johanmeiring
- License: mit
- Created: 2014-02-05T12:23:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-06T09:42:35.000Z (over 11 years ago)
- Last Synced: 2025-03-26T10:45:01.191Z (2 months ago)
- Language: Python
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===========
python-poco
===========python-poco provides classes that can be used to integrate your software with
the South African postal code lookup service at http://poco.co.za. Basic usage
is crazy simple::#!/usr/bin/env python
from poco.poco import PocoSearcher
results = PocoSearcher.results_as_dicts('Wingate Park')
objects = PocoSearcher.results_as_objects('Wingate Park')In the above example, 'results' is a list which contains dictionaries with the
following keys: ``id``, ``suburb``, ``area``, ``postal``, ``street``.
Similarly, 'objects' is a list which contains objects of the ``PocoLocation``
class. The ``PocoLocation`` class has the same keys mentioned above as class
attributes. So basically, use ``results_as_dicts`` or ``results_as_objects``,
depending on what your application needs.**One important caveat:** The following rules apply:
* The search term cannot be empty.
* The search term must contain at least 3 characters.
An exception of type ``requests.exceptions.HTTPError`` will be raised if the above
requirements are not met.For reference, the Poco API documentation is available at
http://poco.co.za/api/.