alexprengere / currencyconverter

A Python currency converter using the European Central Bank data.
http://alexprengere.github.io/currencyconverter
Apache License 2.0
215 stars 59 forks source link

Use the worldbank dataset #39

Closed stormbeforesunsetbee closed 2 years ago

stormbeforesunsetbee commented 2 years ago

First off, thank you for this amazing module. The way you use data analytic approach like interpolation and stuff is just awesome. But there is one problem here, it only support few currencies.

Could you please use this dataset instead: https://data.worldbank.org/indicator/PA.NUS.FCRF ?

alexprengere commented 2 years ago

The module can read any data source as long as it follows the ECB format, which is a simple CSV file, roughly formatted as:

Date            USD JPY BGN CYP CZK DKK EEK GBP HUF
30/06/2022  1.0387  141.54  1.9558  N/A 24.739  7.4392  N/A 0.8582  397.04
29/06/2022  1.0517  143.53  1.9558  N/A 24.739  7.4392  N/A 0.86461 394.28
28/06/2022  1.0561  143.67  1.9558  N/A 24.726  7.4394  N/A 0.8635  398.55

Rather than supporting many formats, I find it simpler that users write a few lines of code to convert any source they want to ECB format. In your case, it looks like a matrix transpose. Then you can use:

c = CurrencyConverter('./path/to/currency/file.csv')
stormbeforesunsetbee commented 2 years ago

HI! Thanks for responding

Rather than supporting many formats, I find it simpler that users write a few lines of code to convert any source they want to ECB format.

Yeah, that's okay

In your case, it looks like a matrix transpose

Sure. I'll try it