Does anybody know how to share the google colab document so people can run the notebook but cannot see the actual code? - data-visualization

I am trying to share the google colab document (that contains my data-visualization project) with friends so they can run the code but not actually see the code, because I don't want them to copy the code. How do I do this?

Related

A good way to locate colab Notebook (from code inside colab notebook)

Colab code runs on a temporarily allocated machine, thus the running environment is not aware of the notebook location on Google Drive.
I am wondering if there is an API which colab provides, which I may invoke programatically, which could tell me the location of colab notebook in Google Drive (I can manually do it by clicking on: file > Locate in drive, but I need to do this via code in Colab). This would be useful to save the data generated by my code.
Of course I can hard code this path (after mounting the gDrive), but each time, I would need to update it, and if I forget it can even overwrite the previous data. Is there a way where it could be automatically detected? It seems this solution: https://stackoverflow.com/a/71438046/1953366 is walking though every path until it matches the filename, which is not efficient and also will fail in case I have same file name at different location.
Any better solution(s)?

Unable to save both user changes when coding during same session

How I understand it, in Colaboratory two people can write code in the same document at the same time. This doesn't seem to be working for us: we are coding in separate sections, but are still struggling to figure out to keep both of our changes. We get the notification below:
"The notebook has been changed outside of this session. Would you like to overwrite existing changes?"
or "Save Failed". Then I get two windows with my edits and his edits, but am unaware how to accept both overides.
Your guidance is much appreciated.
The information I was reading was out-of-date. Google Colaboratory removed the real-time edit functionality:
https://github.com/googlecolab/colabtools/issues/355

can I use Google colabs with someone else?

I'm working with Google colabs with my friend, then in a point of the project we must work at the same time, but sometimes when we will save the project for some of us is asking or telling us that is a error, then we have to save it manually or choose what lines of code should stay or not. Then that is why I'm asking about it, or maybe we have to make some other step like a pull request
thank you so much
I'm not sure if colab have such feature, but how about putting the colab in a github repo? That way you guys can both have your own version of the same notebook on a separate branch and when you need to have you friend's changes, you can just have him push it to the remote repo, then you can pull and merge your branch into his?

BigQuery connecting from GSheet without enabling API every time

I have some scripts running from GSheet getting data from BigQuery. However, in order to make the files run, I need to manually enable the API every time for a given sheet.
So the question is: How to enable API within the code, so that if I share the GSheet or make a copy I don't have to go to the script editor and enable the API from there?
Thanks
I am a huge fan of this particular use of the Google ecosystem, so I'm happy to help get others up and running using GSheets with BigQuery! Hopefully it is working well for you!
When sharing the sheet with others, there is no need to alter anything in the script editor at all. The scripts should run and query BigQuery without issue; this has been my experience at least. The obvious caveat to this is that the users you share it with must have access to the Google Developer Project that the BigQuery instance is associated with.
However, when copying the sheet, I do not believe it is possible to have it replicate the connection. This is because when the file is copied, it becomes associated with a new Google Developer Project. Thus, you have to go into the script editor, then go to Resources > Developers Console Project and change the project listed to the one in which you have BigQuery enabled.
Hopefully this helps! Sorry I don't have better news for you!

Multiple users accessing a same ipynb

I just set up a IPython (0.13.1) Notebook server in order to use it during my introductory course on Python. The server is protected with password and is currently up and running.
Now, I need my students (about 15 people) to access the same ipynb document at the same time, play around with it and eventualy modify the code examples, while making sure anyone overwrites the uploaded version of the ipynb file.
How can I set this up?
First, take a look on teaching with ipython notebook. Try to list what type of applications you want to run on this. On the other hand, it possible to use some cloud computing resources, for example on Heroku.