Repository navigation
python-v0.1.0
Minor Changes
-
New Python package, published on PyPI as
kenya-locations. It has the same lookups, name matching
and typo-tolerant search as the other libraries, with no dependencies:
kl.get_wards_in_constituency("Westlands"),kl.search("Nairob").Optional extras add framework support.
pip install "kenya-locations[django]"adds model fields
that store codes, chained county, constituency and ward selects for forms and the admin, hierarchy
validation, and JSON drill-down views.pip install "kenya-locations[fastapi]"adds a ready-made
read-only router, path dependencies and Pydantic code types.Lookups return
Nonewhen nothing matches, and therequire_*functions raise
LocationNotFoundErrororAmbiguousLocationErrorwith a message that lists the candidates.
Arguments of the wrong type raiseTypeError.
(#79) by
@achingachris
Contributors: @achingachris