Update ISO 4217 currency data for ISO 4217 amendment number 171.
This commit is contained in:
parent
aceb0f09d1
commit
7a9d3d3e8f
3 changed files with 16 additions and 5 deletions
7
Makefile
7
Makefile
|
@ -39,3 +39,10 @@ pre-commit: ## Checks to run before each commit
|
||||||
.PHONY: tox
|
.PHONY: tox
|
||||||
tox: ## Run tests via tox
|
tox: ## Run tests via tox
|
||||||
poetry run tox
|
poetry run 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
|
||||||
|
|
|
@ -24,7 +24,6 @@ Functions:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from datetime import datetime
|
|
||||||
from importlib.resources import read_binary
|
from importlib.resources import read_binary
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -45,9 +44,7 @@ class ISOCurrency:
|
||||||
|
|
||||||
def current_data_date():
|
def current_data_date():
|
||||||
one = etree.fromstring(read_binary("pricehist.resources", "list_one.xml"))
|
one = etree.fromstring(read_binary("pricehist.resources", "list_one.xml"))
|
||||||
pblshd = one.cssselect("ISO_4217")[0].attrib["Pblshd"]
|
return one.cssselect("ISO_4217")[0].attrib["Pblshd"]
|
||||||
date = datetime.strptime(pblshd, "%B %d, %Y").date().isoformat()
|
|
||||||
return date
|
|
||||||
|
|
||||||
|
|
||||||
def historical_data_date():
|
def historical_data_date():
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<ISO_4217 Pblshd="October 1, 2021">
|
<ISO_4217 Pblshd="2022-04-01">
|
||||||
<CcyTbl>
|
<CcyTbl>
|
||||||
<CcyNtry>
|
<CcyNtry>
|
||||||
<CtryNm>AFGHANISTAN</CtryNm>
|
<CtryNm>AFGHANISTAN</CtryNm>
|
||||||
|
@ -1493,6 +1493,13 @@
|
||||||
<CcyNbr>694</CcyNbr>
|
<CcyNbr>694</CcyNbr>
|
||||||
<CcyMnrUnts>2</CcyMnrUnts>
|
<CcyMnrUnts>2</CcyMnrUnts>
|
||||||
</CcyNtry>
|
</CcyNtry>
|
||||||
|
<CcyNtry>
|
||||||
|
<CtryNm>SIERRA LEONE</CtryNm>
|
||||||
|
<CcyNm>Leone</CcyNm>
|
||||||
|
<Ccy>SLE</Ccy>
|
||||||
|
<CcyNbr>925</CcyNbr>
|
||||||
|
<CcyMnrUnts>2</CcyMnrUnts>
|
||||||
|
</CcyNtry>
|
||||||
<CcyNtry>
|
<CcyNtry>
|
||||||
<CtryNm>SINGAPORE</CtryNm>
|
<CtryNm>SINGAPORE</CtryNm>
|
||||||
<CcyNm>Singapore Dollar</CcyNm>
|
<CcyNm>Singapore Dollar</CcyNm>
|
||||||
|
|
Loading…
Add table
Reference in a new issue