Giter Site home page Giter Site logo

ian-wright / everythings-windier-in-texas Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 42.19 MB

Visualizing power prices and wind levels with Kafka/Spark/PubNub in realtime.

Home Page: https://ian-wright.github.io/everythings-windier-in-texas/

Scala 35.37% HTML 24.89% CSS 9.00% JavaScript 14.05% Python 16.68%
spark-streaming kafka pubnub scala leaflet

everythings-windier-in-texas's Introduction

Everything's WINDIER in TEXAS

This project uses Kafka, Spark Streaming, and PubNub, (and Scala) to stream localized wholesale power prices and wind data throughout Texas in realtime @ https://ian-wright.github.io/everythings-windier-in-texas/

screencast

Motivation

Mainly because I wanted a project to learn some data streaming technologies, and dive into Scala programming.

But also... the Texas electricity market (ERCOT - Electricity Reliability Council of Texas) produces more wind-generated power than any other state. This massive wind capacity, combined with the effects of the Federal Production Tax Credit, make for an interesting (and often dramatic) dynamic between realtime wholesale power prices and wind resources. On several particularly windy occasions in the past, localized power prices have actually gone negative. This visualization is meant to monitor the wind - power price relationship, spatially and in realtime.

How the pipeline works

  • Python scripts pull weather data from here and pricing data from here, and push the data to a local single-node two-topic Kafka broker.
  • A Scala app uses Spark Streaming to connect to the Kafka broker, and cleans/filters/processes all data according to topic
  • Scala app publishes the DStream to a realtime messaging cloud service, PubNub, on a singular channel
  • A simple frontend client subscribes to the channel and receives all messages in realtime;

Requirements:

  • Scala 2.11
  • sbt
  • Spark 2.x
  • pip install kafka-python
  • pip install satori-rtm-sdk

Make it go:

To run several concurrent processes, you'll need FIVE tabs open to the repo's directory:

  • If you don't want to run it locally, but want to see the visualization, contact me to "turn it on".

  • Otherwise, clone this repo.

  • (tab #1) - start a local single-node zookeeper instance

    kafka_2.11-0.11.0.0/bin/zookeeper-server-start.sh kafka_2.11-0.11.0.0/config/zookeeper.properties

  • (tab #2) - create the kafka topics on the broker

    kafka_2.11-0.11.0.0/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic price

    kafka_2.11-0.11.0.0/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic weather

  • (still tab #2) - start the single-node kafka broker

    kafka_2.11-0.11.0.0/bin/kafka-server-start.sh kafka_2.11-0.11.0.0/config/server.properties

  • (tab #3) - publish weather data to kafka

    python data_generators/satori_to_kafka.py

  • (tab #4) - publish price data to kafka

    python data_generators/price_to_kafka.py

  • (tab #5) - compile and run

    sbt compile

    sbt run

  • navigate to https://ian-wright.github.io/everythings-windier-in-texas/ and watch some data pour in!

everythings-windier-in-texas's People

Contributors

ian-wright avatar

Stargazers

 avatar W avatar

Watchers

 avatar cexposit 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.