This post shows how you can leverage two powerful python libraries, Beavers and Perspective, to analyse data in realtime and display it in a dashboard.
We will connect to Coinbase's websocket API to receive crypto market updates in real time.
In order to share this data with other services and decouple producers from consumer, we'll publish this data over Kafka, as json.
We'll then write a Beavers that will read the data from Kafka, enrich it, and publish it in a perspective dashboard.
You'll need:
The code for this tutorial is available on github
git clone https://github.com/0x26res/beavers-examples cd beavers-example/coinbase_analytics/
python3 -m venv --clear .venv source ./.venv/bin/activate pip install -r requirements.txt
We use the kafka-kraft docker image to run a super simple kafka cluster.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3