Skip to content

Commit

Permalink
[#8] Update Currency codelist import for CLv3, and redo the import
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Feb 3, 2015
1 parent e38c572 commit c9a2723
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 43 deletions.
5 changes: 4 additions & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ def indent(elem, level=0, shift=2):
codelist_item.append(code)

name = ET.Element('name')
name.text = currency_name
codelist_item.append(name)
narrative = ET.Element('narrative')
narrative.text = currency_name
name.append(narrative)

codelist_items.append(codelist_item)

indent(template.getroot(), 0, 4)
template.write('xml/Currency.xml', pretty_print=True)

18 changes: 11 additions & 7 deletions templates/Currency.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<codelist name="Currency" xml:lang="en" complete="1">
<metadata>
<name>Currency</name>
<description>ISO 4217 Currency used for all transactions and budgets</description>
<url>http://www.iso.org/iso/home/standards/currency_codes.htm</url>
</metadata>
<codelist-items/>
<codelist name="Currency" xml:lang="en" complete="1">
<metadata>
<name>
<narrative>>Currency</narrative>
</name>
<description>
<narrative>ISO 4217 Currency used for all transactions and budgets</narrative>
</description>
<url>http://www.iso.org/iso/home/standards/currency_codes.htm</url>
</metadata>
<codelist-items/>
</codelist>
143 changes: 108 additions & 35 deletions xml/Currency.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<codelist name="Currency" xml:lang="en" complete="1">
<metadata>
<name>
<narrative>Currency</narrative>
<narrative>&gt;Currency</narrative>
</name>
<description>
<narrative>ISO 4217 Currency used for all transactions and budgets</narrative>
Expand Down Expand Up @@ -36,7 +36,7 @@
<codelist-item>
<code>ANG</code>
<name>
<narrative>Netherlands Antillian Guilder</narrative>
<narrative>Netherlands Antillean Guilder</narrative>
</name>
</codelist-item>
<codelist-item>
Expand All @@ -60,7 +60,7 @@
<codelist-item>
<code>AWG</code>
<name>
<narrative>Aruban Guilder</narrative>
<narrative>Aruban Florin</narrative>
</name>
</codelist-item>
<codelist-item>
Expand All @@ -72,7 +72,7 @@
<codelist-item>
<code>BAM</code>
<name>
<narrative>Convertible Marks</narrative>
<narrative>Convertible Mark</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -177,16 +177,28 @@
<narrative>Congolese Franc</narrative>
</name>
</codelist-item>
<codelist-item>
<code>CHE</code>
<name>
<narrative>WIR Euro</narrative>
</name>
</codelist-item>
<codelist-item>
<code>CHF</code>
<name>
<narrative>Swiss Franc</narrative>
</name>
</codelist-item>
<codelist-item>
<code>CHW</code>
<name>
<narrative>WIR Franc</narrative>
</name>
</codelist-item>
<codelist-item>
<code>CLF</code>
<name>
<narrative>Unidades de fomento</narrative>
<narrative>Unidad de Fomento</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -267,12 +279,6 @@
<narrative>Algerian Dinar</narrative>
</name>
</codelist-item>
<codelist-item>
<code>EEK</code>
<name>
<narrative>Kroon</narrative>
</name>
</codelist-item>
<codelist-item>
<code>EGP</code>
<name>
Expand Down Expand Up @@ -324,7 +330,7 @@
<codelist-item>
<code>GHS</code>
<name>
<narrative>Cedi</narrative>
<narrative>Ghana Cedi</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -531,12 +537,6 @@
<narrative>Lithuanian Litas</narrative>
</name>
</codelist-item>
<codelist-item>
<code>LVL</code>
<name>
<narrative>Latvian Lats</narrative>
</name>
</codelist-item>
<codelist-item>
<code>LYD</code>
<name>
Expand Down Expand Up @@ -606,7 +606,7 @@
<codelist-item>
<code>MWK</code>
<name>
<narrative>Malawi Kwacha</narrative>
<narrative>Kwacha</narrative>
</name>
</codelist-item>
<codelist-item>
Expand All @@ -630,7 +630,7 @@
<codelist-item>
<code>MZN</code>
<name>
<narrative>Metical</narrative>
<narrative>Mozambique Metical</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -726,7 +726,7 @@
<codelist-item>
<code>RON</code>
<name>
<narrative>New Leu</narrative>
<narrative>New Romanian Leu</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -802,15 +802,15 @@
</name>
</codelist-item>
<codelist-item>
<code>SSP</code>
<code>SRD</code>
<name>
<narrative>South Sudanese Pound</narrative>
<narrative>Surinam Dollar</narrative>
</name>
</codelist-item>
<codelist-item>
<code>SRD</code>
<code>SSP</code>
<name>
<narrative>Surinam Dollar</narrative>
<narrative>South Sudanese Pound</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -852,7 +852,7 @@
<codelist-item>
<code>TMT</code>
<name>
<narrative>Manat</narrative>
<narrative>Turkmenistan New Manat</narrative>
</name>
</codelist-item>
<codelist-item>
Expand All @@ -864,7 +864,7 @@
<codelist-item>
<code>TOP</code>
<name>
<narrative>Paanga</narrative>
<narrative>Pa&#8217;anga</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -915,16 +915,10 @@
<narrative>US Dollar (Next day)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>USS</code>
<name>
<narrative>US Dollar (Same day)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>UYI</code>
<name>
<narrative>Uruguay Peso en Unidades Indexadas</narrative>
<narrative>Uruguay Peso en Unidades Indexadas (URUIURUI)</narrative>
</name>
</codelist-item>
<codelist-item>
Expand Down Expand Up @@ -969,24 +963,102 @@
<narrative>CFA Franc BEAC</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XAG</code>
<name>
<narrative>Silver</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XAU</code>
<name>
<narrative>Gold</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XBA</code>
<name>
<narrative>Bond Markets Unit European Composite Unit (EURCO)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XBB</code>
<name>
<narrative>Bond Markets Unit European Monetary Unit (E.M.U.-6)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XBC</code>
<name>
<narrative>Bond Markets Unit European Unit of Account 9 (E.U.A.-9)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XBD</code>
<name>
<narrative>Bond Markets Unit European Unit of Account 17 (E.U.A.-17)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XCD</code>
<name>
<narrative>East Caribbean Dollar</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XDR</code>
<name>
<narrative>SDR (Special Drawing Right)</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XOF</code>
<name>
<narrative>CFA Franc BCEAO</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XPD</code>
<name>
<narrative>Palladium</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XPF</code>
<name>
<narrative>CFP Franc</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XPT</code>
<name>
<narrative>Platinum</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XSU</code>
<name>
<narrative>Sucre</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XTS</code>
<name>
<narrative>Codes specifically reserved for testing purposes</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XUA</code>
<name>
<narrative>ADB Unit of Account</narrative>
</name>
</codelist-item>
<codelist-item>
<code>XXX</code>
<name>
<narrative>The codes assigned for transactions where no currency is involved</narrative>
</name>
</codelist-item>
<codelist-item>
<code>YER</code>
<name>
Expand All @@ -1000,7 +1072,7 @@
</name>
</codelist-item>
<codelist-item>
<code>ZMK</code>
<code>ZMW</code>
<name>
<narrative>Zambian Kwacha</narrative>
</name>
Expand All @@ -1013,3 +1085,4 @@
</codelist-item>
</codelist-items>
</codelist>

0 comments on commit c9a2723

Please sign in to comment.