66
77class 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
0 commit comments