Repository navigation
Releases
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
packages/go/v0.1.0
Minor Changes
-
New Go module,
github.com/davidamunga/kenya-locations/packages/go. It has the same lookups, name
matching and typo-tolerant search as the other libraries, with no dependencies:
kl.GetWardsInConstituency("Westlands"),kl.Search("Nairob"). The data is embedded with
go:embedand parsed on first use, every function is safe for concurrent use, and every value
returned is a copy.Lookups return
nilwhen nothing matches or the name is ambiguous. Releases are tagged
packages/go/v{version}. (#82) by
@geoffowuor
Contributors: @geoffowuor
v0.12.0
kenya-locations
Minor Changes
-
Rebuild the sub-counties from the Humanitarian Data Exchange and link every ward to one.
- Data:
sub-counties.jsonis now the 302 DHIS2 sub-counties from the HDX "Kenya Sub
Counties" layer (American Red Cross, CC BY, 2019 to 2020), replacing 307 records that were
mostly constituency names. Two layer entries with no wards (Tiaty, Kalama) are left out. They
are third-party, not an official KNBS or IEBC list, and are close to constituencies. - Ward link: every ward in
wards.jsonnow has asub_county_code, from the HDX
"Administrative Wards in Kenya 1450" layer. 1,346 wards match by exact name; 104 are matched by
similar name or inferred from their constituency, and are listed in
sources/hdx-kenya-wards/matches.json. - Codes changed: sub-county codes are now five digits, the county code plus two digits
(04701), assigned by this project.data/history.jsonmaps each old code to its replacement
(240) or marks it removed (67). - JS and PHP:
getWardsInSubCountyandgetSubCountyOfWardnow use the real link instead of
matching sub-county and constituency names.Wardgainssub_county_code(JS) and
subCountyCode(PHP).getSubCountyByCodezero-pads to five digits.
(#76)
- Data:
WordPress plugin
Download kenya-locations-wordpress-*.zip from the assets below.
- WordPress → Plugins → Add New → Upload Plugin
- Install and activate Kenya Locations
- Requires PHP 8.2+. Installation details are in
readme.txtinside the zip.
v0.11.2
kenya-locations
Patch Changes
- Fix
searchByTypein Kotlin, Swift and .NET returning fewer results than asked for, or none. It
searched every type, kept the toplimit × 6and then filtered by type, so for a common word like
"West" other types filled the slots and no wards survived. The type is now applied before the
limit, as in JS, PHP and Dart. (#74)
WordPress plugin
Download kenya-locations-wordpress-*.zip from the assets below.
- WordPress → Plugins → Add New → Upload Plugin
- Install and activate Kenya Locations
- Requires PHP 8.2+. Installation details are in
readme.txtinside the zip.
v0.11.1
kenya-locations
Patch Changes
-
Data update:
- Areas (1,827 → 1,828)
- Added area Kwa Jose (Juja, Kiambu)
(#68)
- Added area Kwa Jose (Juja, Kiambu)
- Areas (1,827 → 1,828)
-
Data update:
- Areas (1,827 → 1,828)
- Added area Highpoint (Juja, Kiambu)
(#69)
- Added area Highpoint (Juja, Kiambu)
- Areas (1,827 → 1,828)
WordPress plugin
Download kenya-locations-wordpress-*.zip from the assets below.
- WordPress → Plugins → Add New → Upload Plugin
- Install and activate Kenya Locations
- Requires PHP 8.2+. Installation details are in
readme.txtinside the zip.
react-v0.10.4
Patch Changes
- Uses
kenya-locations0.12.0.
react-v0.10.3
Patch Changes
- Uses
kenya-locations0.11.2.
react-v0.10.2
Patch Changes
-
Update the
useAreasdoc comment and README to the current area count (1,829).
(#71) -
Uses
kenya-locations0.11.1.
php-v0.4.0
Minor Changes
-
Rebuild the sub-counties from the Humanitarian Data Exchange and link every ward to one.
- Data:
sub-counties.jsonis now the 302 DHIS2 sub-counties from the HDX "Kenya Sub
Counties" layer (American Red Cross, CC BY, 2019 to 2020), replacing 307 records that were
mostly constituency names. Two layer entries with no wards (Tiaty, Kalama) are left out. They
are third-party, not an official KNBS or IEBC list, and are close to constituencies. - Ward link: every ward in
wards.jsonnow has asub_county_code, from the HDX
"Administrative Wards in Kenya 1450" layer. 1,346 wards match by exact name; 104 are matched by
similar name or inferred from their constituency, and are listed in
sources/hdx-kenya-wards/matches.json. - Codes changed: sub-county codes are now five digits, the county code plus two digits
(04701), assigned by this project.data/history.jsonmaps each old code to its replacement
(240) or marks it removed (67). - JS and PHP:
getWardsInSubCountyandgetSubCountyOfWardnow use the real link instead of
matching sub-county and constituency names.Wardgainssub_county_code(JS) and
subCountyCode(PHP).getSubCountyByCodezero-pads to five digits.
(#76)
- Data: