gophernotes

command module
v0.0.0-...-e685470 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2016 License: MIT Imports: 14 Imported by: 0

README

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 as limited, ipython kernel call iGo.

Screenshots/Examples

Simple interactive use:

alt tag

Story telling and pattern recognition with Markdown and Golang:

alt tag

Local Jupyter Installation/Usage

  • Make sure jupyter notebook and libzmq-dev are installed. See here for more details on installing jupyter.

  • Install goimports if you haven't already:

    go get golang.org/x/tools/cmd/goimports
    
  • 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.

Pain-Free Docker Installation/Usage

  • Pull down and run the latest image:

    docker pull dwhitena/gophernotes:latest
    docker run --name gophernotes --net host -d dwhitena/gophernotes:latest
    
  • Point your browser to localhost:8888.

  • Select Golang from the New drop down menu.

  • Have Fun!

Note - this is a pretty large image, because it contains a full distribution of Anaconda 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.

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

Licenses

gophernotes was created by Daniel Whitenack, and is licensed under an MIT-style License.

The Golang Gopher image was created by Takuya Ueda and is licensed under the Creative Commons 3.0 Attributions license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/alecthomas/gozmq
Go (golang) Bindings for 0mq (zmq, zeromq)
Go (golang) Bindings for 0mq (zmq, zeromq)
_workspace/src/github.com/davecgh/go-spew/spew
Package spew implements a deep pretty printer for Go data structures to aid in debugging.
Package spew implements a deep pretty printer for Go data structures to aid in debugging.
_workspace/src/github.com/motemen/go-quickfix
Package quickfix provides functions for fixing Go ASTs that are well typed but "go build" refuses to build.
Package quickfix provides functions for fixing Go ASTs that are well typed but "go build" refuses to build.
_workspace/src/github.com/motemen/go-quickfix/cmd/goquickfix
The goquickfix command quick fixes Go source that is well typed but go refuses to compile e.g.
The goquickfix command quick fixes Go source that is well typed but go refuses to compile e.g.
_workspace/src/github.com/nu7hatch/gouuid
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
_workspace/src/github.com/pmezard/go-difflib/difflib
Package difflib is a partial port of Python difflib module.
Package difflib is a partial port of Python difflib module.
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
_workspace/src/golang.org/x/tools/go/ast/astutil
Package astutil contains common utilities for working with the Go AST.
Package astutil contains common utilities for working with the Go AST.
_workspace/src/golang.org/x/tools/go/exact
Package exact implements Values representing untyped Go constants and the corresponding operations.
Package exact implements Values representing untyped Go constants and the corresponding operations.
_workspace/src/golang.org/x/tools/go/gcimporter
Package gcimporter implements Import for gc-generated object files.
Package gcimporter implements Import for gc-generated object files.
_workspace/src/golang.org/x/tools/go/types
Package types declares the data types and implements the algorithms for type-checking of Go packages.
Package types declares the data types and implements the algorithms for type-checking of Go packages.
_workspace/src/golang.org/x/tools/go/types/typeutil
Package typeutil defines various utilities for types, such as Map, a mapping from types.Type to interface{} values.
Package typeutil defines various utilities for types, such as Map, a mapping from types.Type to interface{} values.
_workspace/src/golang.org/x/tools/imports
Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary.
Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL