def retrieve_data(self, ticker): # initialise scraper without time interval scraper = CmcScraper(ticker) # get raw data as list of list headers, data = scraper.get_data() # get data in a json format xrp_json_data = scraper.get_data("json") # export the data as csv file scraper.export("csv", name=ticker)
from cryptocmd import CmcScraper # Documentation https://github.com/guptarohit/cryptoCMD # initialise scraper without time interval scraper = CmcScraper("BTC") # get raw data as list of list headers, data = scraper.get_data() # get data in a json format xrp_json_data = scraper.get_data("json") # export the data as csv file, you can also pass optional `name` parameter scraper.export("csv", name="xrp_all_time") # Pandas dataFrame for the same data df = scraper.get_dataframe() result = xrp_json_data[0] print(data[0][1])
#!/usr/bin/env python # -*- coding: utf-8 -*- from cryptocmd import CmcScraper # Initialise scraper with 'coin code' of cryptocurrency # If time interval is not passed all time data will be scrapped scraper = CmcScraper("btc") # You can pass name for the csv explicitly, # Else it will be named in format {coin_code}_{start_date}_{end_date}.csv scraper.export("csv", name="btc_all_time")