akvo.codelists.scripts.iati_codelist_generator module
Generate a python file, codelists_vXXX.py, in the codelists folder that contains a python representation of all IATI codelists, based on the IATI version. See http://iatistandard.org/codelists/ and http://iatistandard.org/codelists/code-list-api/
- akvo.codelists.scripts.iati_codelist_generator.codelist_data(result, version, transform=None)[source]
Create a data structure with the following format: {
‘fields: [‘<field_name_1>’, ‘<field_name_2>’, …, ‘rows: [
- {
‘<field_name_1>’: ‘<codelist_value_1>, ‘<field_name_2>’, ‘<codelist_value_2>, …
}, {
…
}
]
}
- akvo.codelists.scripts.iati_codelist_generator.data_to_strings(data)[source]
Use the data structure created in generate_codelists_data to assemble the string parts of the codelist document.
- akvo.codelists.scripts.iati_codelist_generator.generate_codelists_data(version)[source]
For each codelist extend the data structure returned from codelist_data with a the fields ‘url’ and ‘name’ and append to the list ‘data’ which is returned holding all data for all codelists
- akvo.codelists.scripts.iati_codelist_generator.get_codelists(version, url)[source]
Depending on the codelist version, retrieves the codelists
- akvo.codelists.scripts.iati_codelist_generator.prettify_country_name(country)[source]
ALL CAPS IS UGLY!