Skip to content

Commit 30b10cc

Browse files
committed
typos and grammar
1 parent 186b55e commit 30b10cc

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

docs/source/index.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
forex-python
22
============
33

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

66
Features:
77
---------
88
- List all currency rates.
9-
- BitCoin price for all currencies.
10-
- Converting amount to BitCoins.
9+
- Bitcoin price for all currencies.
10+
- Converting amount to BitCoin.
1111
- Get historical rates for any day since 1999.
12-
- Conversion rate for one currency(ex; USD to INR).
13-
- Convert amount from one currency to other.('USD 10$' to INR)
14-
- Currency Symbols
12+
- Conversion rate for one currency (e.g. USD to INR).
13+
- Convert amount from one currency to another (e.g. 'USD $10' to INR)
14+
- Currency symbols
1515
- Currency names
1616

1717
Contents:

docs/source/usage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ Bitcoin Prices:
6666
>>> b.get_previous_price('USD', date_obj) # get_previous_price('USD', date_obj)
6767
453.378
6868

69-
3. Convert Amout to bitcoins::
69+
3. Convert Amount to Bitcoin::
7070
>>> b.convert_to_btc(5000, 'USD') # convert_to_btc(5000, 'USD')
7171
9.36345369116708
7272

73-
4. Convert Amount to bitcoins based on previous date prices::
73+
4. Convert Amount to Bitcoin based on previous date prices::
7474
>>> date_obj
7575
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
7676
>>> b.convert_to_btc_on(5000, 'USD', date_obj) # convert_to_btc_on(5000, 'USD', date_obj)
7777
11.028325150316071
7878

79-
5. Convert Bitcoins to valid currency amount based on latest price::
79+
5. Convert Bitcoin to valid currency amount based on latest price::
8080
>>> b.convert_btc_to_cur(1.25, 'USD') # convert_btc_to_cur(1.25, 'USD')
8181
668.1012499999999
8282

83-
6. Convert Bitcoins to valid currency amount based on previous date price::
83+
6. Convert Bitcoin to valid currency amount based on previous date price::
8484
>>> date_obj
8585
datetime.datetime(2016, 5, 18, 19, 39, 36, 815417)
8686
>>> b.convert_btc_to_cur_on(1.25, 'EUR', date_obj)
@@ -106,7 +106,7 @@ Bitcoin Prices:
106106

107107
Currency Symbols & Codes
108108
-------------------------
109-
1. Get Currency symbol Using currency code::
109+
1. Get currency symbol using currency code::
110110
>>> from forex_python.converter import CurrencyCodes
111111
>>> c = CurrencyCodes()
112112
>>> c.get_symbol('GBP')
@@ -116,8 +116,8 @@ Currency Symbols & Codes
116116
>>> print c.get_symbol('EUR')
117117
118118

119-
2. Get Currency Name using currency code::
119+
2. Get currency name using currency code::
120120
>>> c.get_currency_name('EUR')
121121
u'European Euro'
122122
>>> c.get_currency_name('INR')
123-
u'Indian rupee'
123+
u'Indian Rupee'

forex_python/bitcoin.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class BtcConverter(object):
88
"""
9-
Get bit coin rates and convertion
9+
Get Bitcoin rates and conversion
1010
"""
1111
def __init__(self, force_decimal=False):
1212
self._force_decimal = force_decimal
@@ -20,7 +20,7 @@ def _decode_rates(self, response, use_decimal=False):
2020

2121
def get_latest_price(self, currency):
2222
"""
23-
Get Lates price of one bitcoin to valid Currency 1BTC => X USD
23+
Get latest price of one Bitcoin to valid currency 1BTC => X USD
2424
"""
2525
url = 'https://api.coindesk.com/v1/bpi/currentprice/{}.json'.format(currency)
2626
response = requests.get(url)
@@ -34,7 +34,7 @@ def get_latest_price(self, currency):
3434

3535
def get_previous_price(self, currency, date_obj):
3636
"""
37-
Get Price for one bit coin on given date
37+
Get price for one Bitcoin on given date
3838
"""
3939
start = date_obj.strftime('%Y-%m-%d')
4040
end = date_obj.strftime('%Y-%m-%d')
@@ -55,7 +55,7 @@ def get_previous_price(self, currency, date_obj):
5555

5656
def get_previous_price_list(self, currency, start_date, end_date):
5757
"""
58-
Get List of prices between two dates
58+
Get list of Bitcoin prices between two dates
5959
"""
6060
start = start_date.strftime('%Y-%m-%d')
6161
end = end_date.strftime('%Y-%m-%d')
@@ -74,7 +74,7 @@ def get_previous_price_list(self, currency, start_date, end_date):
7474

7575
def convert_to_btc(self, amount, currency):
7676
"""
77-
Convert X amount to Bit Coins
77+
Convert X amount to Bitcoin
7878
"""
7979
if isinstance(amount, Decimal):
8080
use_decimal = True
@@ -98,7 +98,7 @@ def convert_to_btc(self, amount, currency):
9898

9999
def convert_btc_to_cur(self, coins, currency):
100100
"""
101-
Convert X bit coins to valid currency amount
101+
Convert X Bitcoin to valid currency amount
102102
"""
103103
if isinstance(coins, Decimal):
104104
use_decimal = True
@@ -122,7 +122,7 @@ def convert_btc_to_cur(self, coins, currency):
122122

123123
def convert_to_btc_on(self, amount, currency, date_obj):
124124
"""
125-
Convert X amount to BTC based on given date rate
125+
Convert X amount to Bitcoin based on a given date's rate
126126
"""
127127
if isinstance(amount, Decimal):
128128
use_decimal = True
@@ -149,11 +149,11 @@ def convert_to_btc_on(self, amount, currency, date_obj):
149149
return converted_btc
150150
except TypeError:
151151
raise DecimalFloatMismatchError("convert_to_btc_on requires amount parameter is of type Decimal when force_decimal=True")
152-
raise RatesNotAvailableError("BitCoin Rates Source Not Ready For Given Date")
152+
raise RatesNotAvailableError("Bitcoin rates source not ready for given date")
153153

154154
def convert_btc_to_cur_on(self, coins, currency, date_obj):
155155
"""
156-
Convert X BTC to valid currency amount based on given date
156+
Convert X Bitcoin to valid currency amount based on given's date rate
157157
"""
158158
if isinstance(coins, Decimal):
159159
use_decimal = True
@@ -180,11 +180,11 @@ def convert_btc_to_cur_on(self, coins, currency, date_obj):
180180
return converted_btc
181181
except TypeError:
182182
raise DecimalFloatMismatchError("convert_btc_to_cur_on requires amount parameter is of type Decimal when force_decimal=True")
183-
raise RatesNotAvailableError("BitCoin Rates Source Not Ready For Given Date")
183+
raise RatesNotAvailableError("Bitcoin rates source not ready for given date")
184184

185185
def get_symbol(self):
186186
"""
187-
Here is Unicode symbol for bitcoin
187+
Here is the Unicode symbol for Bitcoin:
188188
"""
189189
return "\u0E3F"
190190

forex_python/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class RatesNotAvailableError(Exception):
99
"""
10-
Custome Exception when https://theforexapi.com is Down and not available for currency rates
10+
Custom exception when https://theforexapi.com is down and not available for currency rates
1111
"""
1212
pass
1313

tests/test_bitcoin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_previous_price_list_with_invalid_currency(self):
5555

5656
class TestConvertBtc(TestCase):
5757
"""
58-
Test Converting amount to Bit coins
58+
Test converting amount to Bitcoin
5959
"""
6060
def test_convet_to_btc_with_valid_currency(self):
6161
coins = convert_to_btc(250, 'USD')
@@ -67,7 +67,7 @@ def test_convet_to_btc_with_invalid_currency(self):
6767

6868
class TestConvertBtcToCur(TestCase):
6969
"""
70-
Convert Bit Coins to Valid Currency amount
70+
Convert Bitcoin to valid currency amount
7171
"""
7272
def test_convert_btc_to_cur_valid_currency(self):
7373
amount = convert_btc_to_cur(2, 'USD')
@@ -79,7 +79,7 @@ def test_convert_btc_to_cur_invalid_currency(self):
7979

8080
class TestConvertToBtcOn(TestCase):
8181
"""
82-
Convert To bit coin based on previous dates
82+
Convert to Bitcoin based on previous date
8383
"""
8484
def test_convert_to_btc_on_with_valid_currency(self):
8585
date_obj = datetime.datetime.today() - datetime.timedelta(days=15)
@@ -93,7 +93,7 @@ def test_convert_to_btc_on_with_invalid_currency(self):
9393

9494
class TestConvertBtcToCurOn(TestCase):
9595
"""
96-
Convert BitCoins to valid Currency
96+
Convert Bitcoin to valid currency
9797
"""
9898
def test_convert_to_btc_on_with_valid_currency(self):
9999
date_obj = datetime.datetime.today() - datetime.timedelta(days=15)
@@ -107,7 +107,7 @@ def test_convert_to_btc_on_with_invalid_currency(self):
107107

108108
class TestBitCoinSymbol(TestCase):
109109
"""
110-
Bit Coin symbol
110+
Bitcoin symbol
111111
"""
112112
def test_bitcoin_symbol(self):
113113
self.assertEqual(get_btc_symbol(), "\u0E3F")
@@ -218,11 +218,11 @@ def test_previous_price_list_with_invalid_currency(self):
218218
self.assertFalse(price_list)
219219
self.assertEqual(type(price_list), dict)
220220

221-
def test_convet_to_btc_with_valid_currency(self):
221+
def test_convert_to_btc_with_valid_currency(self):
222222
coins = self.b.convert_to_btc(Decimal('250'), 'USD')
223223
self.assertEqual(type(coins), Decimal)
224224

225-
def test_convet_to_btc_with_invalid_currency(self):
225+
def test_convert_to_btc_with_invalid_currency(self):
226226
self.assertRaises(RatesNotAvailableError, self.b.convert_to_btc, Decimal('250'), 'XYZ')
227227

228228
def test_convert_btc_to_cur_valid_currency(self):

0 commit comments

Comments
 (0)