Skip to content

Commit c436243

Browse files
author
Ravi kumar
authored
Merge pull request #18 from ravigadila/bitcoin
0.3.0 Bitcoin feature release
2 parents 91c1bc3 + 612a1a6 commit c436243

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ forex-python
66
[![license](https://img.shields.io/github/license/MicroPyramid/forex-python.svg?maxAge=2592000)](https://pypi.python.org/pypi/forex-python)
77
[![Code Health](https://landscape.io/github/MicroPyramid/forex-python/master/landscape.svg?style=plastic)](https://landscape.io/github/MicroPyramid/forex-python/master)
88

9-
Free Foreign exchange rates and currency conversion.
9+
Free Foreign exchange rates, bitcoin prices and currency conversion.
1010

1111
Features:
1212
---------

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = u'0.2.3'
62+
version = u'0.3.0'
6363
# The full version, including alpha/beta/rc tags.
64-
release = u'0.2.3'
64+
release = u'0.3.0'
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.

docs/source/currencysource.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ List of Supported Currency codes.
4141
|PLN - Poland Zloty
4242
|PHP - Philippines Peso
4343
|ZAR - South Africa Rand
44+
45+
Bitcoin Prices:
46+
---------------
47+
Bitcoin prices calculated every minute from CoinDesk API.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
forex-python
22
============
33

4-
Free Foreign exchange rates and currency conversion.
4+
Free Foreign exchange rates, bitcoin prices and currency conversion.
55

66
Features:
77
---------

docs/source/usage.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ Currency Rates
66
1. list all latest currency rates for "USD"::
77
>>> from forex_python.converter import CurrencyRates
88
>>> c = CurrencyRates()
9-
>>> c.get_rates('USD')
9+
>>> c.get_rates('USD') # you can directly call get_rates('USD')
1010
{u'IDR': 13625.0, u'BGN': 1.7433, u'ILS': 3.8794, u'GBP': 0.68641, u'DKK': 6.6289, u'CAD': 1.3106, u'JPY': 110.36, u'HUF': 282.36, u'RON': 4.0162, u'MYR': 4.081, u'SEK': 8.3419, u'SGD': 1.3815, u'HKD': 7.7673, u'AUD': 1.3833, u'CHF': 0.99144, u'KRW': 1187.3, u'CNY': 6.5475, u'TRY': 2.9839, u'HRK': 6.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'PLN': 3.94, u'PHP': 46.775, u'ZAR': 15.747}
1111

1212
2. List all Currency rates for "USD" on 2012-09-05::
1313
>>> date_obj
1414
datetime.datetime(2014, 5, 23, 18, 36, 28, 151012)
15-
>>> c.get_rates('USD', date_obj)
15+
>>> c.get_rates('USD', date_obj) # same as get_rates('USD', date_obj)
1616
{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, u'AUD': 1.0845, u'CHF': 0.89582, u'KRW': 1024.9, u'CNY': 6.2377, u'TRY': 2.0888, u'HRK': 5.5751, u'NZD': 1.1707, u'THB': 32.6, u'LTL': 2.5332, u'NOK': 5.9652, u'RUB': 34.122, u'INR': 58.509, u'MXN': 12.893, u'CZK': 20.131, u'BRL': 2.2178, u'PLN': 3.0544, u'PHP': 43.721, u'ZAR': 10.356}
1717

1818
3. Get conversion rate from USD to INR::
19-
>>> c.get_rate('USD', 'INR')
19+
>>> c.get_rate('USD', 'INR') # same as get_rate('USD', 'INR')
2020
67.473 # return type float
2121

2222
4. Get conversion rate from USD to INR on 2014-05-23::
2323
>>> date_obj
2424
datetime.datetime(2014, 5, 23, 18, 36, 28, 151012)
25-
>>> c.get_rate('USD', 'INR', date_obj)
25+
>>> c.get_rate('USD', 'INR', date_obj) # get_rate('USD', 'INR', date_obj)
2626
58.509
2727

2828
5. Convert amount from USD to INR::
29-
>>> c.convert('USD', 'INR', 10)
29+
>>> c.convert('USD', 'INR', 10) # convert('USD', 'INR', 10)
3030
674.73
3131

3232
6. Convert amount from USD to INR based on 2014-05-23 exchange rates::
@@ -40,27 +40,27 @@ Bitcoin Prices:
4040
1. Get latest price of one Bitcoin::
4141
>>> from forex_python.bitcoin import BtcConverter
4242
>>> b = BtcConverter()
43-
>>> b.get_latest_price('EUR')
43+
>>> b.get_latest_price('EUR') # you can directly call get_latest_price('EUR')
4444
476.5225 # return type float
4545

4646
2. Get price of Bitcoin based on prevois date::
4747
>>> date_obj
4848
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
49-
>>> b.get_previous_price('USD', date_obj)
49+
>>> b.get_previous_price('USD', date_obj) # get_previous_price('USD', date_obj)
5050
453.378
5151

5252
3. Convert Amout to bitcoins::
53-
>>> b.convert_to_btc(5000, 'USD')
53+
>>> b.convert_to_btc(5000, 'USD') # convert_to_btc(5000, 'USD')
5454
9.36345369116708
5555

5656
4. Convert Amount to bitcoins based on previous date prices::
5757
>>> date_obj
5858
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
59-
>>> b.convert_to_btc_on(5000, 'USD', date_obj)
59+
>>> b.convert_to_btc_on(5000, 'USD', date_obj) # convert_to_btc_on(5000, 'USD', date_obj)
6060
11.028325150316071
6161

6262
5. Convert Bitcoins to valid currency amount based on lates price::
63-
>>> b.convert_btc_to_cur(1.25, 'USD')
63+
>>> b.convert_btc_to_cur(1.25, 'USD') # convert_btc_to_cur(1.25, 'USD')
6464
668.1012499999999
6565

6666
6. Convert Bitcoins to valid currency amount based on previous date price::
@@ -74,11 +74,11 @@ Bitcoin Prices:
7474
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
7575
>>> end_date
7676
datetime.datetime(2016, 5, 23, 19, 39, 36, 815417)
77-
>>> b.get_previous_price_list('INR', start_date, end_date)
77+
>>> b.get_previous_price_list('INR', start_date, end_date) # get_previous_price_list('INR', start_date, end_date)
7878
{u'2016-05-19': 29371.7579, u'2016-05-18': 30402.3169, u'2016-05-22': 29586.3631, u'2016-05-23': 29925.3272, u'2016-05-20': 29864.0256, u'2016-05-21': 29884.7449}
7979

8080
8. Get Bitcoin symbol::
81-
>>> print(b.get_symbol())
81+
>>> print(b.get_symbol()) # get_btc_symbol()
8282
฿
8383

8484
Currency Symbols & Codes

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from setuptools import setup, find_packages
44

5-
VERSION = '0.2.3'
5+
VERSION = '0.3.0'
66

77
with io.open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding='utf-8', errors='ignore') as readme:
88
LONG_DESCRIPTION = readme.read()

0 commit comments

Comments
 (0)