A Spring boot notebook for python
Here below a succint representation of the application architecture :
It comprised three (3) main packages :
- com.oracle.notebook.model : it contents the models representing the input code and the result of the execution;
- com.oracle.notebook.grammar : it contents the classes for python language parsing ;
- com.oracle.notebook.interpreter : it contains the solely class NotebookInterpreter considered as the core of the application. It take the input , parse it and give the result of the interpretation. The application is a Spring Boot based application with additional librairies such as jython(used as an embedded python interpreter for java), ANTLR (used for generating the recognizer of python language and many others)
- Clone the project
- Unzip and go the root of project
- Ignite the commands (example for linux niche):
./mvnw clean install
and
java -jar target/notebook-0.0.1-SNAPSHOT.jar
or execute in your favorite editor through the project execution shortcut. 4. Submit a JSON object with a such a structure
{"code":"%python pythoncode"}
where pythoncode is a python snippet, to the endpoint /execute like this :
curl -X POST http://localhost:8080/execute -d '{"code": "%python a=23 "}'
You can also test with API test environment such as Postman.
Constantin DRABO ([email protected])