Local notebook to be shared

Hi, I am new to data science and am supposed to share a Jupyter notebook that contains links that save the code creating new local files. I use them in the code then.

My questions is: how do I make the code/notebook accessible for others so they can run it (although with links to local files) too?
Thanks a lot.

There’s a lot of options out there and so I’ll mention some here …

If your actual computation needs aren’t huge and the current ‘local’ notebook you reference in your post title and all related contents and material can be shared publicly, you can use MyBinder.org to serve the notebook and associated files from a public repository in an active temporary Jupyter session where everything is already installed and ready to run with no need for a login. Before I go into to details only to learn that won’t work for your needs, I’ll just point to an example that you can try directly and then gauge if the solution will work for you. Go here and click launch binder. An active Jupyter session will spin up being served by MyBinder. A page will open with available notebooks. (This one starts out in the classic notebook interface, but if you prefer JupyterLab, just click the Jupyter logo in the upper left and it will switch to that and you can open the index.ipynb file to get back to the same place.) The idea is to work though the notebooks in the series in order. For the sake of your interests, it doesn’t matter what the point of the code is for this demonstration. You should be able to look or even work through them and see the notebooks are generating files from the code and various resources, storing them on the remote machine, and using them as if they are ‘local’ to the notebook for downstream processing. (I think something like that is what you were seeking to do.) The idea is this sets up things and then users can modify the code or upload files to look at data of interest to them. And you’ll see notes that if something useful is generated on the remote session, to download it back to your actual local machine.

When considering MyBinder use as an option, keep in mind there are other ways to obfuscate or make things unclear while still sharing content publicly. One option is to leave out the launch badges and provide instructions to run and other critical points to understand and use the software separately to your users via a direct email or something. So while the content that you need to make it work is public, you don’t make it easy to use to outsiders. Additionally, you can make toy data for the demonstration. Since the remote machine isn’t secured though, obviously some types of data shouldn’t be uploaded.

Have you looked at the thread ‘How do you share notebooks? Best practices around sharing to external stakeholders?’ and Announcing NotebookSharing.space: The fastest way to share your notebooks!. Although it seems you are concerned about the files the notebook generates while running, you may want to make a version that makes a defined set of files that you can insure get made if all steps are followed.

Not present (I believe) in those discussions I point out in the last paragraph, because it is relatively new is WASM-based Jupyterlite, see here. If what you used can run in web assembly, you can share a static site that let’s your users run JupyterLite inside their browser and then anything you cannot share publicly, you can guide them how to use their computers to run the code or add anything needed extra your provide. Most of the data science stack in the Python ecosystem is working. As the tech needed to get JupyterLite accessible inside user’s browser is static, it tends to be free to host most places and cheaper than providing a server running JupyterLab or a full JupyterHub to your interested parties. (With this, the so-called ‘local’ stuff becomes located within the user’s browser machinery and currently isn’t directly accessible from the user’s graphical user interface, which can be a bit confusing to those new to it.)There is also JupyterLab Desktop, see here and so if you are lucky enough to have a defined operating system for your users then maybe you can easily guide them through running things and know that it will the same situation as how you developed your guide to using it.

2 Likes