def test_bad_current(self): with self.assertRaises(AttributeError): return Current.get_current('kkk')
def test_get_current(self): cur = Current(TestCoinsta.k) cur_btc = cur.get_current('btc') size = len(cur_btc.keys()) self.assertEqual(size, 13)
def test_get_current(self): btc_current = Current.get_current('btc') no_items = len(btc_current.index) self.assertEqual(no_items, 12)
alt_spec = Historical.from_strings('btc', '2018-3-1', '2018-6-1', hyphen=True) alt_btc = alt_spec.get_data() print(alt_btc.head()) # another alternative method for "/" formatted date strings other_spec = Historical.from_strings('btc', '2018/3/1', '2018/6/1', hyphen=False) another_btc = other_spec.get_data() print(another_btc.head()) # get current market information on a specified crypto btc_current = cur.get_current('btc') print(btc_current) # get the top 100 cryptos (in terms of market cap) current_100 = cur.top_100() print(current_100.head()) # get global overview of crypto markets glo_info = cur.global_info() print(glo_info) # Historical Snapshot snap_period = date(2013, 4, 28) early_2013 = HistoricalSnapshot(snap_period).get_snapshot() print(early_2013.info())