@@ -42,6 +42,10 @@ The code for the library is [here](https://github.com/OCHA-DAP/hdx-python-countr
4242The library has detailed API documentation which can be found in the menu at the top.
4343
4444## Breaking Changes
45+ From 4.1.1, HXL hashtags no longer used in AdminLevel class. The header names are used
46+ instead. setup_from_iterable replaces setup_from_admin_info and
47+ setup_from_libhxl_dataset using keys: "Location", "P-Code", "Name" and "Parent P-Code".
48+
4549From 4.1.0, HXL hashtags no longer used in Country class. The header names are used
4650instead.
4751
@@ -154,23 +158,21 @@ A Retrieve object can be passed in the *retriever* parameter that enables
154158saving data downloaded to a file or loading previously saved data depending
155159on how the Retrieve object is configured.
156160
157- Once an AdminLevel object is constructed, one of three setup methods must be
158- called: * setup_from_admin_info* , * setup_from_libhxl_dataset* or
159- * setup_from_url* .
161+ Once an AdminLevel object is constructed, either * setup_from_iterable* or
162+ * setup_from_url* must be called.
163+
164+ Method * setup_from_iterable* takes an iterable (eg. iterator or sequence) of the form:
160165
161- Method * setup_from_admin_info * takes key * admin_info * which is a list with
162- values of the form:
166+ {"Location": "AFG", "P-Code": "AF01", "Name": "Kabul"}
167+ {"Location": "AFG", "P-Code": "AF0101", "Name": "Kabul", "Parent P-Code": "AF01"}
163168
164- {"iso3": "AFG", "pcode": "AF01", "name": "Kabul"}
165- {"iso3": "AFG", "pcode": "AF0101", "name": "Kabul", "parent": "AF01"}
166169
167170Dictionaries * pcode_to_name* and * pcode_to_iso3* are populated in the
168- AdminLevel object. * parent * is optional, but if provided enables lookup of
171+ AdminLevel object. * Parent P-Code * is optional, but if provided enables lookup of
169172location names by both country and parent rather than just country which should
170173help with any name clashes. It also results in the population of a dictionary
171174in the AdminLevel object * pcode_to_parent* .
172175
173- Method * setup_from_libhxl_dataset* takes a libhxl Dataset object, while
174176* setup_from_url* takes a URL which defaults to a resource in the global p-codes
175177dataset on HDX.
176178
0 commit comments