Package: currency-converter-with-rate
Currency Converter with RateThis is a simple python package for currency conversion between any two or to multiple currency. Also, to get latest and historical currency exchange rates & crypto exchange rates. This is based on the free APIexchangerate.FeaturesConversion rate for one or multiple currencyFor all or some specific currency:Get latest ratesGet historical rates. Historical means on a speficifc dateGet timeseries rates, between any two datesGet fluctuation rates,  between any two datesSources [Currency symbols, Bank sources, Language code formatter, crypto-currencies]For all currency symbols, language code for locale formatter, bank source codes, crypto-currency codes, check thisSymbol & Code SourcesUsage ExampleThe followings are examples when you will use it as a package:1. Currency ConversionTo convert one currency to another, you may chain method like thisfrom currency_converter_with_rate import currency
currency = currency.Currency()

data = currency.convert().base('USD').target('EUR').get()If you want onlyconverteroption, you may use like this:from currency_converter_with_rate import converter
currency = converter.CurrencyConverter()

data = currency.base('USD').target('EUR').get()The output will be like this:[
  {
    'from': 'USD', 
    'to': 'EUR', 
    'converted_amount': 0.846571, 
    'success': True
  }
]here,base()andtarget()is required method. Other available methods you will see in following examples are optional.You can find all the currency symbols to pass in base() and target() method for conversion in the above source link, under the file namedcurrency-symbols.txtThe following examples are given using mainCurrency()classMultiple targets:In above example, target currency is only one. If you want to convert to multiple targets, use like following: (send multiple currency code as a list)data = currency.convert().base('USD').target(['EUR', 'BDT', 'CZK']).get()Available methods:amount(): By default, base amount is 1.00, you can change it by usingamount()data = currency.convert().base('USD').target('EUR').amount(10).get()places(): for rounding currency value upto specific decimal point. The following example will round to 2 decimal point of the target currency valuedata = currency.convert().base('USD').target('EUR').amount(100).places(2).get()format_language(): to format the price according to a locale formatter, such as if you want to format currency as United Kingdom's format.data = currency.convert().base('USD').target('EUR').amount(10).places(2).format_language('en-gb').get()You can find all language code for locale format, in the above source link, under the file namedlanguage-codes-list.txtdate(): to convert currency on a rate of a specific date. In this method, date paremeter must be in YYYY-MM-DD formatdata = currency.convert().base('USD').target('EUR').amount(10).date('2019-08-01').get()source(): There are 2 different types of source.Bank source: Currency conversion according to a bank reference. In this case, you have to pass the bank's code in thesource(). You can find all bank source code, in the above source link, under the file namedbank_sources.txtdata = currency.convert().base('USD').target('EUR').amount(10).source('ecb').get()Crypto Currency: Untill now, we are converting physical currency. If you want conversion between two crypto-currency, you have to usesource(crypto)for all kind of crypto currency.And in bothbase()andtarget()method, you have to pass any crypto-currency symbols, instead of physical currency, like following:data = currency.convert().base('BTC').target('PAC').amount(10).source('crypto').get()The above example convert from bitcoin (BTC) to PAC Protocol (PAC). You can find all crypto-currency symbols, in the above source link, under the file namedcrypto-currencies.txtNote: You don't have to follow any chaining sequence to use or call the optional methods. Just make sure, you call any of them beforeget().get()must be last method in the chain.Such as, you can callplaces()beforeamount(), like,data = currency.convert().base('USD').target('EUR').places(2).amount(100).get()2. RatesThere are 4 types of rates option.2.1 For latest rate: uselatest()2.2 for historical rate: usehistorical("2021-05-24"): here date is required, and format must beYYYY-MM-DD2.3 for fluctuations rate: usefluctuations("2021-01-01", "2021-01-03"): herestart_date&end_dateis required, and both format must beYYYY-MM-DD2.4 for timeseries rate: usetimeseries("2021-01-01", "2021-01-03"): herestart_date&end_dateis required, and both format must beYYYY-MM-DDFor all those rates,you may userates()method ofCurrencyclass like following:from currency_converter_with_rate import currency
currency = currency.Currency()

data = currency.rates().latest().get()Or, you may use onlyRatesclass like following:from currency_converter_with_rate import rates
currency = rates.Rates()

data = currency.latest().get()Based on which type of rates, you want to get, the methods will be different. But all these rate types, have some common available optional methods. These are following:1. base(): for changing the base currency (by default EUR, i.e. euro): Enter 3-letter currency code for preferred base currency
2. target(): for target currency: Enter 3-letter currency code, to get multiple target currency, send a comma separated string with 3 digit symbol, without any whitespace, 
             like  currency.rates().latest().target("USD,EUR,BDT").get()
3. amount(): to set amount to convert, default it is 1.00 from EURO
4. places(): to set how many decimal point to show for target amount
5. source(): to set source for bank view or crypto-currency
      - for bank, give any bank code (3 letter code) as a cource
      - for crypto, source will always be `crypto`, like, source('crypto')
    This is same as above source() method in currency conversion.
6. format(): to set local currency format language codeNote: You don't have to follow any chaining sequence to use or call the optional methods. Just make sure, you call any of them before get(). Just like explained above examplesThe following examples are given using mainCurrency()class.2.1 Get Latest RatesTo get all latest rates (convert from, by default euro, based on amount 1.00)rate = currency.rates().latest().get()The output will be like this:{
      "rates": {
          "AED": 4.338675,
          "AFN": 101.678441,
          "ALL": 121.876549,
          "AMD": 581.637933,
          "ANG": 2.119571,
          "AOA": 749.461213,
          "ARS": 115.296454,
          "AUD": 1.613746,
          "AWG": 2.126898,
          "AZN": 2.008353,
          "BAM": 1.958162,
          "BBD": 2.362678,
          "BDT": 100.615467,
          "BGN": 1.956466,
          "BHD": 0.446148,
          "BIF": 2342.930853,
          "BMD": 1.181473,
          "BND": 1.589243,
          "BOB": 8.13793,
          "BRL": 6.12316,
          "BSD": 1.181635,
          ...
      },
      "success": true
  }an example with all available optional methods, for single target symbolrate = currency.rates().latest().base('USD').target("EUR").get()an example with all available optional methods, for multiple target symbolrate = currency.rates().latest().base('USD').target("EUR,CZK,USD").amount(100).places(2).source('ecb').format('en-za').get()2.2 Get Historical Ratesan example with all available optional methods, multiple target symbolrate = currency.rates().historical("2021-08-30").base('USD').target("USD,EUR,CZK").amount(100).places(2).source('ecb').format('en').get()as explained above, a date must be passed as a parameter insidehistorical()in YYYY-MM-DD format. This date indicates that, the rates were for that specific day.Output will look like following:{
    "rates": {
        "CZK": "$2,166.43",
        "EUR": "$84.74",
        "USD": "$100.00"
    },
    "success": true
}2.3 Get Fluctuation Ratesan example with all available optional methods, multiple target symbol2 required parameters forfluctuations():start_date: in YYYY-MM-DD formatend_date: in YYYY-MM-DD formatrate = currency.rates().fluctuations("2021-01-01", "2021-01-03").base('USD').target("EUR,CZK").amount(100).places(2).source('ecb').format('en').get()Output will look like following:{
    "rates": {
        "CZK": {
            "change": 0,
            "change_pct": 0,
            "end_rate": "$2,138.54",
            "start_rate": "$2,138.54"
        },
        "EUR": {
            "change": 0,
            "change_pct": 0,
            "end_rate": "$81.49",
            "start_rate": "$81.49"
        }
    },
    "success": true
}2.4 Get Timeseries Ratesan example with all available optional methods, multiple target symbol2 required parameters:start_date: in YYYY-MM-DD formatend_date: in YYYY-MM-DD formatrate = currency.rates().timeseries("2021-01-01", "2021-01-03").base('USD').target("EUR,CZK").amount(100).places(3).source('ecb').format('en').get()Output will look like following:{
    "rates": {
        "2021-01-01": {
            "CZK": "$2,138.54",
            "EUR": "$81.49",
            "USD": "$100.00"
        },
        "2021-01-02": {
            "CZK": "$2,138.54",
            "EUR": "$81.49",
            "USD": "$100.00"
        },
        "2021-01-03": {
            "CZK": "$2,138.54",
            "EUR": "$81.49",
            "USD": "$100.00"
        }
    },
    "success": true
}If you send wrong parameter/s, in the available methods, or if there is any error in API, you will get an error response like following:{
    "success": False,
    "message": "Something went wrong in the server, please wait"
}