`gophernotes` is a Go kernel for [Jupyter](http://jupyter.org/) 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](http://nbviewer.jupyter.org/). Go forth and do data science, or anything else interesting, with go notebooks!
This project came out of the [Gopher Gala](http://gophergala.com/) 2016. It is inspired by a REPL called [gore](https://github.com/motemen/gore) and by a, no longer maintained and self-described as limited, ipython kernel call [iGo](https://github.com/takluyver/igo).
### Example Notebooks (dowload and run them locally, follow the links to view in Github, or use the [Jupyter Notebook Viewer](http://nbviewer.jupyter.org/)):
*Note* - this is a pretty large image, because it contains a full distribution of [Anaconda](http://docs.continuum.io/anaconda/index) plus the add ons of gophernotes. However, with this image, you can create Go notebooks, Python notebooks, text files, run ipython in the shell, etc.
- Update `~/.ipython/kernels/gophernotes/kernel.json` with the path to your $GOPATH installation. If you used the path above, your file will look like:
The gophernotes repo includes some sample notebooks.
If you start your Jupyter server in a parent directory of your $GOPATH, you can find these in
$GOPATH/src/github.com/gophergala2016/gophernotes/examples in the Jupyter interface.
You can also clone the gophernotes repo into a subdirectory that will be visible from the notebook interface.
- Have Fun!
## Troubleshooting
### gophernotes not found
- 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.
### "Kernel error" in a running notebook
```
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/notebook/base/handlers.py", line 458, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 1008, in run
value = future.result()
...
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
```
Stop jupyter, if it's already running.
Add a symlink to `/go/bin/gophernotes` from your path to the gophernotes executable. If you followed the instructions above, this will be:
Some of the custom commands from the [gore](https://github.com/motemen/gore) REPL have carried over to `gophernotes`. Note, in particular, the syntax for importing packages: