Giter VIP home page Giter VIP logo

streaming_data's Introduction

Welcome to Streaming Data 101!

This is meant to be a recipe for running streaming pipelines in Python.

What's going on?

Subscribe to a pubsub topic, extract data and store in a BigQuery Table.

What you'll need

- Python 3.7
- Apache Beam
- GCP Project
- Dataflow and PubSub APIs Enabled
- Access to BigQuery

Example

First clone this repo.

git clone https://github.com/meirelon/streaming_data.git
cd streaming_data

Next, create a virtual environment with Python37 and install the apache beam dependency.

virtualenv py37
source activate py37
pip install -r requirements.txt

Then create a new bucket for streaming logs.

gsutil mb gs://[PROJECT ID]-streaming

Create a folder within this bucket called tmp which will be used later in the process.

For this example, we are going to use the NYC Taxi Rides pubsub topic provided by GCP. Now we deploy! The command is going to look like the following:

python -m example --runner DataflowRunner \
                  --project [PROJECT ID] \
                  --temp_location gs://[PROJECT ID]-streaming/tmp/ \
                  --input_topic "projects/pubsub-public-data/topics/taxirides-realtime" \
                  --output_table "[PROJECT ID]:[DATASET NAME].[TABLE NAME]" \
                  --streaming

Resources

More information about subscribing to the NYC Taxi Rides pubsub here. Please read about how pubsub works here.

Contribute

I am happy to review PRs, or if you liked this example, I also gladly accept Crypto Currency!

streaming_data's People

Contributors

meirelon avatar

Watchers

James Cloos avatar  avatar

Forkers

shukla41

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.