Skip to content

Latest commit

 

History

History
118 lines (83 loc) · 3.45 KB

README.md

File metadata and controls

118 lines (83 loc) · 3.45 KB

stop coivd

forthebadge made-with-python

Maintenance PyPI license PyPI pyversions

Background

With sensors devices being affordable and accurate, It is almost inevitable for any business to leverage fresh data, which aids in the automation of many sectors and gives us the capability to respond to live events. In 2019 there were 26.66 billion active IoT devices in the world. That number is expected to reach 75 billion by 2025.

I wanted to leverage IoT to fight the pandemic that had taken 435 thousand lives away from their loved ones. Consequently, I wanted to build an application that promotes social distancing and improves public health during the COVID-19 pandemic by using simulated cell-phone signals .

Tech Stack

pipe

Data

We are mimicking cellphone signals using Python with the help of Faker library.

Set up your environment

  • The Beam SDK requires Python 2 users to use Python 2.7 and Python 3 users to use Python 3.5 or higher. Check your version by running:
python --version
  • Install pip If you do not have pip version 7.0.0 or newer, run the following command to install it. This command might require administrative privileges.
pip install --upgrade pip
  • Install Python virtual environment (HIGHLY RECOMMENDED)
pip install --upgrade virtualenv
  • Create and activate a virtual environment
virtualenv /path/to/directory

-Install Dependenicies

pip install apache-beam
pip install geopy
pip install google-cloud-pubsub
pip install Faker

Running Instructions

  • Clone the repo

  • Change GCP's account info

    • Project ID
    • PubSub subscriptions
    • GCP's JSON key for authorization
  • CD to g-cloud

cd g-cloud
  • Publish Messages using:

python run_publish.py <--total_message_to_send (int)> (optional)
  • Consume:

  • Beam is engine agnostic and can run many different engines (Spark, Flink, DataFlow ....). In this run, we will be using GCP's managed serviced DataFlow as the runner. However, we can change the runner to Flink or Spark by changing the "--runner" argument to any runner that I have configured in the "Runners Folder"
python -m \
    Beam-flink \
    --project \
    <Project Name> \
    --runner DataflowRunner \
    --temp_location \
    <GC BUCKET>/temp \
    --output \
    <GC BUCKET>/results/output \
    --job_name <namme> \
    -- <Region> ex: region us-central1

unified

App Demo (Please click the video below)

Watch the video

License

MIT

Note

Use the package manager pip to install foobar.

pip install foobar

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.