RubyMoney / google_currency

Ruby Money::Bank interface for the Google Currency exchange data
http://rubymoney.github.com/google_currency
MIT License
182 stars 90 forks source link

Update README with unsupported currencies and exchanges #48

Closed antstorm closed 3 years ago

antstorm commented 8 years ago

I did a bit of testing around Google Finance Converter and found out that not only it doesn't support all the currencies that money gem has, but it also has a list of exchanges that it can not perform.

Here's a script that I used:

require 'money'
require 'money/bank/google_currency'

Money.default_bank = Money::Bank::GoogleCurrency.new

rate_error = {}

Money::Currency.stringified_keys.each do |from|
  Money::Currency.stringified_keys.each do |to|
    begin
      Money.new(100_00, from).exchange_to(to)
    rescue Money::Bank::UnknownRate
      rate_error[from] ||= []
      rate_error[from] << to
    rescue StandardError
      p "Unsupported currency: #{from} or #{to}"
    end
  end
end

Also, since every exchange rate is fetched one by one, the whole process took quite a bit of time and ate 144MB (!!!) of traffic. Which makes me think that we need to deprecate this gem in favour of something better.

printercu commented 8 years ago

👍 For 31684 (178 \ 2) conversions its just 4kb for each rate. Don't think it's too much, while every app don't need them all in a single moment.

However it'll be good to find other free api.

antstorm commented 8 years ago

Yeah, you're right, most of the apps won't need all the rates, but I'm pretty sure that the entire exchange ledger should be no bigger than 500KB.

Anyways, googling for a swappable API didn't give much results, so I wonder if there's a reason for not deprecating this repo in favour of other better APIs out there (like EU central bank or currencylayer).

printercu commented 8 years ago

When I tried that gems, they had more missing rates than googlecurrency (about a year ago).

antstorm commented 8 years ago

Oh, really? So you think that alternatives are not good enough and there's room for another one?

printercu commented 8 years ago

At least we may not deprecate googlecurrency while it works. I'll check missing rates in eucb later.

antstorm commented 8 years ago

Yeah, sure, makes perfect sense to keep it running then