forex-python-readthedocs-io-en-latest
forex-python-readthedocs-io-en-latest
Release 0.3.0
1 Features: 3
1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Usage Examples: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 currency source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
i
ii
forex-python Documentation, Release 0.3.0
Contents 1
forex-python Documentation, Release 0.3.0
2 Contents
CHAPTER 1
Features:
1.1 Installation
3
forex-python Documentation, Release 0.3.0
˓→': 4.081, u'SEK': 8.3419, u'SGD': 1.3815, u'HKD': 7.7673, u'AUD': 1.3833, u
˓→6731, u'NZD': 1.4777, u'THB': 35.73, u'EUR': 0.89135, u'NOK': 8.3212, u'RUB
˓→': 66.774, u'INR': 67.473, u'MXN': 18.41, u'CZK': 24.089, u'BRL': 3.5473, u
>>> date_obj
datetime.datetime(2014, 5, 23, 18, 36, 28, 151012)
>>> c.get_rates('USD', date_obj) # same as get_rates('USD', date_obj)
{u'IDR': 11612.0, u'BGN': 1.4349, u'ILS': 3.4861, u'GBP': 0.5938, u'DKK': 5.
˓→4762, u'CAD': 1.0901, u'JPY': 101.92, u'HUF': 222.66, u'RON': 3.2359, u'MYR
˓→': 3.2101, u'EUR': 0.73368, u'SEK': 6.6471, u'SGD': 1.2527, u'HKD': 7.7519,
˓→0888, u'HRK': 5.5751, u'NZD': 1.1707, u'THB': 32.6, u'LTL': 2.5332, u'NOK':
>>> date_obj
datetime.datetime(2014, 5, 23, 18, 36, 28, 151012)
>>> c.get_rate('USD', 'INR', date_obj) # get_rate('USD', 'INR', date_obj)
58.509
>>> date_obj
datetime.datetime(2014, 5, 23, 18, 36, 28, 151012)
>>> c.convert('USD', 'INR', 10, date_obj)
585.09
4 Chapter 1. Features:
forex-python Documentation, Release 0.3.0
>>> date_obj
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
>>> b.get_previous_price('USD', date_obj) # get_previous_price('USD', date_
˓→obj)
453.378
>>> date_obj
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
>>> b.convert_to_btc_on(5000, 'USD', date_obj) # convert_to_btc_on(5000,
˓→'USD', date_obj)
11.028325150316071
>>> date_obj
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
>>> b.convert_btc_to_cur_on(1.25, 'EUR', date_obj)
504.23625000000004
>>> start_date
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
>>> end_date
datetime.datetime(2016, 5, 23, 19, 39, 36, 815417)
>>> b.get_previous_price_list('INR', start_date, end_date) # get_previous_
˓→price_list('INR', start_date, end_date)
˓→29884.7449}
>>> c.get_currency_name('EUR')
u'European Euro'
>>> c.get_currency_name('INR')
u'Indian rupee'
6 Chapter 1. Features:
forex-python Documentation, Release 0.3.0
1.3.1 https://ratesapi.io
https://ratesapi.io is a free API for current and historical foreign exchange rates published by European Central Bank.
The rates are updated daily 3PM CET.
Updated On 2018-05-08
|EUR - Euro Member Countries |IDR - Indonesia Rupiah |BGN - Bulgaria Lev |ILS - Israel Shekel |GBP - United
Kingdom Pound |DKK - Denmark Krone |CAD - Canada Dollar |JPY - Japan Yen |HUF - Hungary Forint |RON -
Romania New Leu |MYR - Malaysia Ringgit |SEK - Sweden Krona |SGD - Singapore Dollar |HKD - Hong Kong
Dollar |AUD - Australia Dollar |CHF - Switzerland Franc |KRW - Korea (South) Won |CNY - China Yuan Renminbi
|TRY - Turkey Lira |HRK - Croatia Kuna |NZD - New Zealand Dollar |THB - Thailand Baht |USD - United States
Dollar |NOK - Norway Krone |RUB - Russia Ruble |INR - India Rupee |MXN - Mexico Peso |CZK - Czech Republic
Koruna |BRL - Brazil Real |PLN - Poland Zloty |PHP - Philippines Peso |ZAR - South Africa Rand