3

I am building a heat map for my company from a generated csv. After a lot of reading I built it using jupyter notebooks (online) using the gmaps API. I've never done anything like this before and jupyter/python/gmaps made it easy to accommodate my requirements (allows for zooming, hovering over a point displays data, easy data cleaning).

Now I've reached the point where I need to share what I have built (with non-programmers). Right now the user can hit a button and a csv generates, I then take that csv and manually place it in my jupyter notebook folder, my code reads it in via pandas and generates the heatmap. I've seen a lot of resources pointing to github, nbviewer, Colaboratory and others but can't seem to find anything that allows user input. Ideally users would be able to click the button and a heatmap would appear (online or not). Security is also an issue so I am not able to make this project public.

Is there a way to make jupyter notebooks (with gmaps) into an executable that allows input? Or another way to securely share my project that automates the csv upload? Am I looking at this from completely the wrong angle and need to change my technology?

Thank you very much in advanced! I am new to this kind of project and appreciate any help :)

More Info: Windows 10, General environment: visual studio 2019 C#, Current project: python 3

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
camilleion
  • 71
  • 4
  • What do you mean by "making this project public"? Do you want to host it on a website so that it can be accessed from anywhere? Or sharing a script file will work for you? Try to post a minimal reproducible example. – Abhishek Agnihotri Sep 03 '20 at 19:50
  • I would not want anyone outside of the company to have access to it. I am open to anyone with the specific URL having access. A script file could potentially work although I'm not sure what that would look like, would the script login to online jupyter notebooks? Or everyone would need Python installed? Minimal reproducible example is that each person is able to click a button which generates a csv and it would also generate the heatmap. I'm open to how this would work. – camilleion Sep 03 '20 at 20:10
  • 1
    I think [google-colab](https://colab.research.google.com/) will work for you. It will give you Jupyter notebook environment in the cloud. You can also share the notebook with any of your teammates. Give it a try!! – Abhishek Agnihotri Sep 03 '20 at 20:15
  • @ABHISHEKAGNIHOTRI I'm open to it! Is there a way for it to automatically upload a local csv to be ran in their notebooks? I am also more seriously looking into azure notebooks since everyone in the company already has a microsoft account. – camilleion Sep 03 '20 at 21:42

2 Answers2

2

I decided I was thinking about jupyter notebooks in the wrong way and that that technology is more for research/data science. I decided to just make a website that launches when the user clicks the button and have the data auto upload. I changed my technology to google maps javascript api and this seems to do everything I need it to do. I changed my data from csv to json but otherwise I think this is the right answer for me.

camilleion
  • 71
  • 4
0

There is a framework called Mercury that can be used to convert Jupyter Notebook to interactive web app.

The use-case that you described can be very easily solved:

  1. Add raw cell with YAML config:
---
title: Upload file demo
description: Show how to upload a file in notebook with Mercury
show-code: False
params:
    filename:
        input: file
        maxFileSize: 1MB
        label: Please upload CSV file
---
  1. The above YAML will generate file upload widget.
  2. The uploaded file can be accessed in the notebook by variable filename which will store the path to new uploaded files.

The example notebook: enter image description here

The application generated with Mercury: enter image description here

Disclaimer: I'm the author of Mercury.

pplonski
  • 5,023
  • 1
  • 30
  • 34