Beispiel #1
0
 def test_historical_snapshot(self):
     snap_date = date(2018, 7, 29)
     july_2018 = HistoricalSnapshot(snap_date)
     july_2018_snapshot = july_2018.get_snapshot()
     len_july_2018 = len(july_2018_snapshot.columns)
     self.assertEqual(len_july_2018, 10)
Beispiel #2
0
 def test_snapshot_period(self):
     with self.assertRaises(BadSnapshotURL):
         fake_date = date(1999, 1, 1)
         return HistoricalSnapshot(fake_date).get_snapshot()
Beispiel #3
0
# 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())

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())