从CoinMarketCap获取历史加密资产数据
cryptoassetdata的Python项目详细描述
从CoinMarketCap获取历史加密资产市场数据的python模块。 为了减少流量,缓存了提取的数据。此外,为了提高性能,加载所需的页面是线程化的。返回日期为索引的pandas数据帧。由于符号not是唯一的,因此使用website slug符号。
文档
见requirements.txt 其他依赖项的文件:
安装
PIP安装:
$ pip install cryptoassetdata
从源安装:
$ git clone https://github.com/linuskohl/cryptoassetdata $ pip install -r requirements.txt $ python setup.py install
使用量
绘制以太坊开放数据的示例代码
importcryptoassetdataimportmatplotlib.pyplotaspltdefavailable_assets():# As Symbols are not unique, the website slugs are used.# Get a list of available crypt assetsprint(cryptoassetdata.get_slugs())defplot_ethereum_price():# get_historic_data takes an array containing asset slugs, start and end date of the data.# fill_na specifies if the DataFrame contains only dates the assets were traded, or every date# in the specified date range. A dictionary containing a DataFrame for every is returned.data=cryptoassetdata.get_historic_data(["ethereum"],"01/01/2017","12/31/2017",fill_na=True)ethereum=data['ethereum'].Open# Get open data from Ethereumethereum.plot()plt.show()# Display plot
贡献
变更日志
请参阅CHANGES.txt获取列表 所有的变化。
许可证
该项目是根据gplv3许可证授权的。有关详细信息,请参见LICENSE.txt。