Esempio n. 1
0
 def test_snapshot_strings2(self):
     july_2018 = HistoricalSnapshot.from_strings('2018/7/29', hyphen=False)
     len_july_2018 = len(july_2018.columns)
     self.assertEqual(len_july_2018, 10)
Esempio n. 2
0
 def test_snapshot_strings(self):
     july_2018 = HistoricalSnapshot.from_strings('2018-7-29')
     len_july_2018 = len(july_2018.columns)
     self.assertEqual(len_july_2018, 10)
Esempio n. 3
0
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())

early_2013 = HistoricalSnapshot.from_strings('2013/4/28', hyphen=False)
print(early_2013.info())

early_2013 = HistoricalSnapshot.from_strings('2013-4-28')
print(early_2013.info())

print(Historical(ticker='btc', start=date(2016, 1, 2)))

snap_date = date(2018, 7, 29)
july_2018 = HistoricalSnapshot(snap_date)
july_2018_snapshot = july_2018.get_snapshot()
print(july_2018_snapshot.info())

fake_date = date(1999, 1, 1)
fake_data = HistoricalSnapshot(fake_date).get_snapshot()
print(fake_data.info())