1

From a .Net C# front end, I need to call and pass parameters to a Jupyter notebook. The Jupyter notebook then returns a string. I am developing under Windows 10 Professional and will need to run on an Azure Windows Server VM. My searches have found info about Jupyter calling C#. Again, my requirement is the reverse. Help is appreciated.

G. Young
  • 41
  • 1
  • 7
  • Another option: My C# programs succesfully calls Python using Processstartinfo call. Can this call sequence work: C# calls Python with then call Jupyter Notebook. Jupyter returns string to Python and passed back to C#. https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo?view=netframework-4.7.2 – G. Young Nov 27 '20 at 16:55
  • The nbconvert API function allows Python to call a Jupyter notebook. https://nbconvert.readthedocs.io/en/latest/execute_api.html#executing-notebooks-using-the-python-api-interface. I'll test this flow and report back: C # -> Python - > Jupyter Notebook. – G. Young Dec 01 '20 at 19:57

1 Answers1

0

I would rather do it differently since there is no straightforward legit approach like a library/api method call. Even if there exists any hacky way, I am not aware of.

Run the notebook as a REST API locally using something like Jupyter Kernel Gateway. A simple blog post has an example. Call the REST API from C# just like a regular http client.

krishg
  • 5,935
  • 2
  • 12
  • 19