To run the binance.py
and app.py
scripts, follow the instructions below:
Clone the repository containing the scripts to your local machine.
git clone https://github.com/danylo-d/algo_zeus_test_task.git
Navigate to the project directory and install the required dependencies by running the following command:
pip install -r requirements.txt
Open the config.ini
file in the project directory and replace the placeholders <Providers>
and <PieChart>
and <Binance>
with your Data
- In Providers, insert the name of the csv file generated after running binance.py
- In PieChart, insert the name of the cryptocurrency for which you want to know the capitalisation /n
- In Binance, you need to insert the Binance API base url link, symbol and interval
Open a terminal or command prompt, navigate to the project directory, and run the following command to execute the binance.py
script:
python binance.py
This script retrieves data from the Binance API and saves it to a CSV file with a filename in the format symbol_interval_year_month_day_hour_minute_second.csv
.
In the same terminal or command prompt, run the following command to start the Flask application:
python app.py
The Flask application will be running locally at http://127.0.0.1:5000/
.
Open a web browser and visit http://127.0.0.1:5000/candlestick
to view the Candlestick Chart generated from the CSV data.
To view the Market Caps Pie Chart, visit http://127.0.0.1:5000/market_caps
in your web browser.
Note: Make sure to keep the binance.py
script running or rerun it periodically to fetch updated data from the Binance API.
That's it! You have successfully run the binance.py
script to fetch data from the Binance API and displayed it using the Flask application.