Coder Social home page Coder Social logo

gophernotes's Introduction

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

Example Notebooks (dowload and run them locally, follow the links to view in Github, or use the Jupyter Notebook Viewer):

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
    #to do in windows use 
    docker run --net host -d dwhitena/gophernotes jupyter notebook --ip=0.0.0.0
    or:
    docker run -p 8888:8888 -d dwhitena/gophernotes jupyter notebook --ip=0.0.0.0
    
  • 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.

gophernotes's People

Contributors

dwhitena avatar naveenholla avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.