Dyson Take Home Assessment (Coin Gecko Crypto)
CryptoDataAnalyzer is a simple Python tool designed to fetch and analyze cryptocurrency data from the CoinGecko API. It provides a wrapper around the pycoingecko library, allowing users to easily retrieve data for specific cryptocurrencies and timeframes.
- Install the required package:
pip install pycoingecko- Import the CryptoDataAnalyzer class into your Python Script or Jupyter Notebook:
import CryptoDataAnalyzer
from CryptoDataAnalyzer import CryptoDataAnalyzer- Create an instance of the CryptoDataAnalyzer class:
crypto_analyzer = CryptoDataAnalyzer()- Fetch data for the desired cryptocurrencies and timeframes (xxx = Cryptocurrency name):
dataframe_xxx = crypto_analyzer.get_crypto_data('xxx', start_date, end_date)- Generate line plots for each cryptocurrency's prices, market cap, and total volume:
dataframes = {
'xxx': dataframe_xxx,
}
timeframe = (start_date, end_date)
crypto_analyzer.generate_line_plot_prices(dataframes, timeframe)
crypto_analyzer.generate_line_plot_market_cap(dataframes, timeframe)
crypto_analyzer.generate_line_plot_total_volume(dataframes, timeframe)For additional details and usage examples, please refer to the Jupyter notebook titled CryptoDataAnalyzerUsage provided in the repository.
Pytest is done in the test_crypto_data_analyzer.ipynb file.
Users can simply run the notebook to check if the test results are positive.