Giter Club home page Giter Club logo

arjunprakash027 / fake-heart-sensor-data-using-python-and-kafka Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 2.03 MB

Fake-Heart-Sensor-Data-Using-Python-and-Kafka is a GitHub project that provides a simple and easy-to-use way to generate simulated heart sensor data using Python and Kafka. This project is ideal for developers who want to test their applications with realistic heart sensor data or simulate a data stream for research purposes.

Python 86.02% Dockerfile 7.58% Shell 6.40%
kafka datastream fake-data-generator python heart-rate-data heartrate-analysis kafka-python medical-dataset

fake-heart-sensor-data-using-python-and-kafka's Introduction

Fake-Heart-Sensor-Data-Using-Python-and-Kafka

STEP 1: DOWNLOAD KAFKA

Download and Setup Kafka on Windows and Linux

Kafka is a distributed streaming platform that allows you to publish and subscribe to streams of records. In this guide, we will provide links to download and set up Kafka on both Windows and Linux operating systems.

Download Kafka

Windows

You can download the latest version of Kafka for Windows from the Apache Kafka website.

Linux

To download Kafka on Linux, open a terminal and run the following command:

wget https://apache.mirror.digitalpacific.com.au/kafka/3.1.0/kafka_2.13-3.1.0.tgz

This command will download the latest version of Kafka available at the time of writing this guide.

Set Up Kafka

Once you have downloaded the Kafka binaries, follow the steps below to set up Kafka on your system.

Windows

  1. Extract the Kafka archive you downloaded to a directory of your choice.

  2. Navigate to the Kafka directory and open the config folder.

  3. Edit the zookeeper.properties file and replace the dataDir property with a directory path where you want to store ZooKeeper data.

  4. Start ZooKeeper by running the following command from the Kafka directory: bin\windows\zookeeper-server-start.bat config\zookeeper.properties

  5. Open a new command prompt window and navigate to the Kafka directory.

  6. Edit the server.properties file and replace the log.dirs property with a directory path where you want to store Kafka logs.

  7. Start Kafka by running the following command from the Kafka directory: bin\windows\kafka-server-start.bat config\server.properties

Linux

  1. Extract the Kafka archive you downloaded to a directory of your choice.

  2. Navigate to the Kafka directory and open the config folder.

  3. Edit the zookeeper.properties file and replace the dataDir property with a directory path where you want to store ZooKeeper data.

  4. Start ZooKeeper by running the following command from the Kafka directory:bin/zookeeper-server-start.sh config/zookeeper.properties

  5. Open a new terminal window and navigate to the Kafka directory.

  6. Edit the server.properties file and replace the log.dirs property with a directory path where you want to store Kafka logs.

  7. Start Kafka by running the following command from the Kafka directory:bin/kafka-server-start.sh config/server.properties

STEP 2 : Running python script

Run kafka server

pip install -r requirements.txt

How to use producer

  1. go to terminal where the python code producer.py is and type python producer.py

How to use consumer (producer must be running in order to use this command)

Use consumer to run stream of fake heart data

  1. go to terminal where the consumer.py is and type python consumer.py stream

Use consumer to create dataset of fake heart data (dataset.json must be present in order to run this command)

(dataset.json is automatically formed when running stream using python consumer.py stream command)

  1. go to terminal where the consumer.py is and type python consumer.py dataset

fake-heart-sensor-data-using-python-and-kafka's People

Contributors

arjunprakash027 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.