From 765e2ec77de97f87abc782943c5cdf086d293838 Mon Sep 17 00:00:00 2001 From: Chris Berkhout Date: Fri, 23 Sep 2022 17:05:54 +0200 Subject: [PATCH] Rename ISO 4217 data files to match SIX Group's new naming. --- Makefile | 8 ++++---- src/pricehist/isocurrencies.py | 12 ++++++------ .../resources/{list_one.xml => list-one.xml} | 0 .../resources/{list_three.xml => list-three.xml} | 0 4 files changed, 10 insertions(+), 10 deletions(-) rename src/pricehist/resources/{list_one.xml => list-one.xml} (100%) rename src/pricehist/resources/{list_three.xml => list-three.xml} (100%) diff --git a/Makefile b/Makefile index eb13631..49bbeb9 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ tox: ## Run tests via tox .PHONY: fetch-iso-data fetch-iso-data: ## Fetch the latest copy of the ISO 4217 currency data - wget -O src/pricehist/resources/list_one.xml \ - https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list_one.xml - wget -O src/pricehist/resources/list_three.xml \ - https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list_three.xml + wget -O src/pricehist/resources/list-one.xml \ + https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml + wget -O src/pricehist/resources/list-three.xml \ + https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-three.xml diff --git a/src/pricehist/isocurrencies.py b/src/pricehist/isocurrencies.py index fe02678..bd453dc 100644 --- a/src/pricehist/isocurrencies.py +++ b/src/pricehist/isocurrencies.py @@ -8,8 +8,8 @@ currencies are included and countries with no universal currency are ignored. The data is read from vendored copies of the XML files published by the maintainers of the standard: -* :file:`list_one.xml` (current currencies & funds) -* :file:`list_three.xml` (historical currencies & funds) +* :file:`list-one.xml` (current currencies & funds) +* :file:`list-three.xml` (historical currencies & funds) Classes: @@ -43,20 +43,20 @@ class ISOCurrency: def current_data_date(): - one = etree.fromstring(read_binary("pricehist.resources", "list_one.xml")) + one = etree.fromstring(read_binary("pricehist.resources", "list-one.xml")) return one.cssselect("ISO_4217")[0].attrib["Pblshd"] def historical_data_date(): - three = etree.fromstring(read_binary("pricehist.resources", "list_three.xml")) + three = etree.fromstring(read_binary("pricehist.resources", "list-three.xml")) return three.cssselect("ISO_4217")[0].attrib["Pblshd"] def by_code(): result = {} - one = etree.fromstring(read_binary("pricehist.resources", "list_one.xml")) - three = etree.fromstring(read_binary("pricehist.resources", "list_three.xml")) + one = etree.fromstring(read_binary("pricehist.resources", "list-one.xml")) + three = etree.fromstring(read_binary("pricehist.resources", "list-three.xml")) for entry in three.cssselect("HstrcCcyNtry") + one.cssselect("CcyNtry"): if currency := _parse(entry): diff --git a/src/pricehist/resources/list_one.xml b/src/pricehist/resources/list-one.xml similarity index 100% rename from src/pricehist/resources/list_one.xml rename to src/pricehist/resources/list-one.xml diff --git a/src/pricehist/resources/list_three.xml b/src/pricehist/resources/list-three.xml similarity index 100% rename from src/pricehist/resources/list_three.xml rename to src/pricehist/resources/list-three.xml