pip install -e ./
jupyter notebook --NotebookApp.nbserver_extensions="{'nbrest.ext':True}"
To automatically expose a function in an HTTP endpoint, decorate it with nbrest.resources.expose:
fromnbrest.resourcesimportexpose# Expose the `foo`function in the URL http://localhost:5000/hello/@expose("/hello/")deffoo():
return"hello world!"# Expose the `foo`function in the URL http://localhost:5000/add/?x=8&y=9@expose("/add/")defadd(x, y):
returnx+y