spencerpark / jupyter-jvm-client Goto Github PK
View Code? Open in Web Editor NEWA Java library for launching, connecting, and communicating with a Jupyter kernel.
License: MIT License
A Java library for launching, connecting, and communicating with a Jupyter kernel.
License: MIT License
Hi ,
When I look project commits latest commit was almost two years ago. Is this project usable? We just want to implement jupyter enterprise gateway like functionality in Java and we need a jupyter client.
Thank you in advance
List<String> configPaths =Arrays.asList(
"/Users/xxx/.jupyter",
"/Users/xxx/opt/anaconda3/etc/jupyter",
"/usr/local/etc/jupyter",
"/etc/jupyter");
List<String> dataPaths =
Arrays.asList(
"/Users/xxx/Library/Jupyter",
"/Users/xxx/opt/anaconda3/share/jupyter",
"/usr/local/share/jupyter",
"/usr/share/jupyter");
List<String> runtimePaths = Arrays.asList("/Users/xxx/Library/Jupyter/runtime");
JupyterPaths jupyterPaths =
new JupyterPaths(
configPaths.stream().map(Path::of).collect(Collectors.toList()),
dataPaths.stream().map(Path::of).collect(Collectors.toList()),
runtimePaths.stream().map(Path::of).collect(Collectors.toList()));
KernelSpecManager kernelSpecManager = KernelSpecManager.fromPaths(jupyterPaths);
Map<String, KernelSpec> allSpecs = kernelSpecManager.getAllSpecs();
System.out.println(allSpecs);
KernelConnectionProperties kernelConnectionProperties =
new KernelConnectionProperties(
"127.0.0.1", 8990, 8991, 8992, 8993, 8994, "tcp", "hmac-sha256", "");
ZmqJupyterClient zmqJupyterClient =
ZmqJupyterClient.createConnectedTo(kernelConnectionProperties);
ExecutionResult eval = zmqJupyterClient.eval("print(1+1)", IOProvider.STDIO);
String data = (String) eval.getValue().getData(MIMEType.APPLICATION_JSON);
System.out.println(data);
I confused on the "key" parameter when creating KernelConnectionProperties. which config does this "key" exactly indicate?
is it c.NotebookNotary.secret? c.GatewayClient.client_key? c.NotebookApp.keyfile? c.Session.key?
In addition, how do you tell if a client is connected to the kernel? I run the code above and the console is logging "INFO: Loop started." but nothing from code execution. I really appreciate the code you open sourced. Thank you!
Since there's no doc about the code, do you mind writing a small example code for this zmqJupyterClient?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.