codeforIATI / codelist-updater

👀 Updater for https://github.com/codeforIATI/IATI-Codelists-NonEmbedded and https://github.com/codeforIATI/Unofficial-Codelists
MIT License
2 stars 0 forks source link

Add reporting org codelist #29

Closed andylolz closed 3 years ago

andylolz commented 3 years ago

WIP because it would be nice to make reporting org type use codes rather than narratives.

markbrough commented 3 years ago

I used this mapping file for reporting organisations: https://github.com/IATI/ckanext-iati/blob/d1a8776181c494eed0fd33c85f44878c88349613/ckanext/iati/lists.py#L27-L38

We could also consider mapping countries by pulling in this list, though perhaps as a separate file? https://github.com/IATI/ckanext-iati/blob/d1a8776181c494eed0fd33c85f44878c88349613/ckanext/iati/countries.py

markbrough commented 3 years ago

(But I think this is also good to go as it is!)

markbrough commented 3 years ago

Sample output:


<codelist xmlns:codeforiati="https://codeforiati.org/" name="ReportingOrganisation" xml:lang="en" complete="1" embedded="0">
    <metadata>
        <name>
            <narrative>Reporting Organisation</narrative>
            <narrative xml:lang="fr">Organisation déclarante</narrative>
        </name>
        <url>https://iatiregistry.org/publisher</url>
        <category>
            <narrative>Replicated</narrative>
        </category>
    </metadata>
    <codelist-items>
        <codelist-item status="active">
            <code>AU-5</code>
            <name>
                <narrative>Australia - Department of  Foreign Affairs and Trade</narrative>
            </name>
            <codeforiati:organisation-type-code>10</codeforiati:organisation-type-code>
            <codeforiati:organisation-type>Government</codeforiati:organisation-type>
            <codeforiati:hq-country-or-region>Australia</codeforiati:hq-country-or-region>
        </codelist-item>
    </codelist-items>
</codelist>
andylolz commented 3 years ago

Nice one, this is great! Thanks!