Skip to content

campoy/gophernotes

Repository files navigation

alt tag

gophernotes - Go in Notebooks

gophernotes is a Go kernel for Jupyter notebooks. Finally, we can have a reliable and maintained way to use Go interactively and code in the browser. Use gophernotes to create and share documents that contain live Go code, equations, visualizations and explanatory text. These notebooks, with the live Go code, can then be shared with others via email, Dropbox, GitHub and the Jupyter Notebook Viewer. Go forth and do data science, or anything else interesting, with go notebooks!

This project came out of the Gopher Gala 2016. It is based on a REPL called gore and on a, no longer maintained and self-described limited, ipython kernel call iGo.

Screenshots/Examples

Simple interactive use:

alt tag

Story telling and pattern recognition with Markdown and Golang:

alt tag

Example Notebooks (they render quite nice within Github, or use the Jupyter Notebook Viewer):

Jupyter Installation/Usage

  • Make sure jupyter notebook is installed. See here for more details.

  • Get the kernel:

    go get github.com/gophergala2016/gophernotes
    
  • Create a directory for the new kernel config:

    mkdir -p ~/.ipython/kernels/gophernotes
    
  • Copy the kernel config into the .ipython directory:

    cp -r $GOPATH/src/github.com/gophergala2016/gophernotes/kernel/* ~/.ipython/kernels/gophernotes
    
  • Start the jupyter notebook:

    jupyter notebook
    
  • Select Golang from the New drop down menu.

  • Have Fun!

Possible Issues:

  • Depending on your environment, you may need to manually change the path to the gophernotes executable in kernel/kernel.json before copying it to ~/.ipython/kernels/gophernotes. You can put the full path to the gophernotes executable here, and you shouldn't have any further issues.

Custom commands

Some of the custom commands from the gore REPL have carried over to gophernotes. Note in particular the syntax for importing packages:

:import <package path>  Import package
:print                  Show current source
:write [<filename>]     Write out current source to file
:help                   List commands

Gopher Gala Status

  • Rewrite of some of the gore functionality to process messages from the notebook.
  • Implement more intuitive error handling in the notebook, test the suite of functionality in the Jupyter notebook.
  • Refactor, loggings
  • Examples, screenshots, installation
  • Troubleshoot errors, unit testing
  • Godep
  • Dockerfile?

About

It's time to use Go in notebooks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%