Last active
August 29, 2015 14:11
-
-
Save nkarnik/b90ee7aa20c141dd4c8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zillabyte | |
import csv | |
cartodb_key = "YOUR_KEY_HERE" | |
map_name = "business_map" | |
class CartoEach: | |
def execute(self, controller, tup): | |
controller.emit({"tup" : tup, "cartodb_key" : cartodb_key, "map_name" : map_name}) | |
app = zillabyte.app(name = "zilla_commerce") | |
stream = app.source_from_csv("businesses.csv", headers=["business"]) | |
stream = stream.call_component("business_locator") | |
map_stream = stream.each(CartoEach) | |
map_stream = stream.call_component("sink_to_cartodb") | |
sink = stream.sink(name="business_locations", columns = [{"business":"string"},{"latitude":"float"},\ | |
{"longitude":"float"},{"full_address":"string"},\ | |
{"zip_code":"integer"}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment