gophernotes
The Go kernel for Jupyter notebooks and nteract.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 29 committers (6.9%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
The Go kernel for Jupyter notebooks and nteract.
Basic Info
Statistics
- Stars: 3,940
- Watchers: 81
- Forks: 264
- Open Issues: 52
- Releases: 17
Topics
Metadata Files
README.md

gophernotes - Use Go in Jupyter notebooks and nteract
gophernotes is a Go kernel for Jupyter notebooks and nteract. It lets you use Go interactively in a browser-based notebook or desktop app. 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!
Acknowledgements - This project utilizes a Go interpreter called gomacro under the hood to evaluate Go code interactively. The gophernotes logo was designed by the brilliant Marcus Olsson and was inspired by Renee French's original Go Gopher design.
- Examples
- Install gophernotes:
- Getting Started
- Limitations
- Troubleshooting
Examples
Jupyter Notebook:

nteract:

Example Notebooks (download and run them locally, follow the links to view in Github, or use the Jupyter Notebook Viewer):
Installation
Prerequisites
- Go 1.13+ - including GOPATH/bin added to your PATH (i.e., you can run Go binaries that you
go install). - Jupyter Notebook or nteract
- git - usually already present on Linux and Mac OS X. If not present, follow the instructions at https://git-scm.com/download
Linux or FreeBSD
The instructions below should work both on Linux and on FreeBSD.
Method 1: quick installation as module
sh
go install github.com/gopherdata/gophernotes@v0.7.5
mkdir -p ~/.local/share/jupyter/kernels/gophernotes
cd ~/.local/share/jupyter/kernels/gophernotes
cp "$(go env GOPATH)"/pkg/mod/github.com/gopherdata/gophernotes@v0.7.5/kernel/* "."
chmod +w ./kernel.json # in case copied kernel.json has no write permission
sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
Method 2: manual installation from GOPATH
sh
mkdir -p "$(go env GOPATH)"/src/github.com/gopherdata
cd "$(go env GOPATH)"/src/github.com/gopherdata
git clone https://github.com/gopherdata/gophernotes
cd gophernotes
git checkout -f v0.7.5
go install
mkdir -p ~/.local/share/jupyter/kernels/gophernotes
cp kernel/* ~/.local/share/jupyter/kernels/gophernotes
cd ~/.local/share/jupyter/kernels/gophernotes
chmod +w ./kernel.json # in case copied kernel.json has no write permission
sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
To confirm that the gophernotes binary is installed in GOPATH, execute it directly:
sh
"$(go env GOPATH)"/bin/gophernotes
and you should see the following:
sh
2017/09/20 10:33:12 Need a command line argument specifying the connection file.
Note - if you have the JUPYTER_PATH environmental variable set or if you are using an older version of Jupyter, you may need to copy this kernel config to another directory. You can check which directories will be searched by executing:
sh
jupyter --data-dir
Mac
Important Note - gomacro relies on the plugin package when importing third party libraries. This package works reliably on Mac OS X with Go 1.10.2+ as long as you never execute the command strip gophernotes.
Method 1: quick installation as module
sh
go install github.com/gopherdata/gophernotes@v0.7.5
mkdir -p ~/Library/Jupyter/kernels/gophernotes
cd ~/Library/Jupyter/kernels/gophernotes
cp "$(go env GOPATH)"/pkg/mod/github.com/gopherdata/gophernotes@v0.7.5/kernel/* "."
chmod +w ./kernel.json # in case copied kernel.json has no write permission
sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
Method 2: manual installation from GOPATH
sh
mkdir -p "$(go env GOPATH)"/src/github.com/gopherdata
cd "$(go env GOPATH)"/src/github.com/gopherdata
git clone https://github.com/gopherdata/gophernotes
cd gophernotes
git checkout -f v0.7.5
go install
mkdir -p ~/Library/Jupyter/kernels/gophernotes
cp kernel/* ~/Library/Jupyter/kernels/gophernotes
cd ~/Library/Jupyter/kernels/gophernotes
chmod +w ./kernel.json # in case copied kernel.json has no write permission
sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
To confirm that the gophernotes binary is installed in GOPATH, execute it directly:
sh
"$(go env GOPATH)"/bin/gophernotes
and you should see the following:
sh
2017/09/20 10:33:12 Need a command line argument specifying the connection file.
Note - if you have the JUPYTER_PATH environmental variable set or if you are using an older version of Jupyter, you may need to copy this kernel config to another directory. You can check which directories will be searched by executing:
sh
jupyter --data-dir
Windows
Important Note - gomacro relies on the plugin package when importing third party libraries. This package is only supported on Linux and Mac OS X currently. Thus, if you need to utilize third party packages in your Go notebooks and you are running on Windows, you should use the Docker install and run gophernotes/Jupyter in Docker.
Download gophernotes inside GOPATH, compile and install it
go env GOPATH > temp.txt set /p GOPATH=<temp.txt mkdir %GOPATH%\src\github.com\gopherdata cd /d %GOPATH%\src\github.com\gopherdata git clone https://github.com/gopherdata/gophernotes cd gophernotes git checkout -f v0.7.5 go installCopy the kernel config:
mkdir %APPDATA%\jupyter\kernels\gophernotes xcopy %GOPATH%\src\github.com\gopherdata\gophernotes\kernel %APPDATA%\jupyter\kernels\gophernotes /sNote, if you have the
JUPYTER_PATHenvironmental variable set or if you are using an older version of Jupyter, you may need to copy this kernel config to another directory. You can check which directories will be searched by executing:jupyter --data-dirUpdate
%APPDATA%\jupyter\kernels\gophernotes\kernel.jsonwith the FULL PATH to your gophernotes.exe (usually in %GOPATH%\bin). For example:{ "argv": [ "C:\\gopath\\bin\\gophernotes.exe", "{connection_file}" ], "display_name": "Go", "language": "go", "name": "go" }
Docker
You can try out or run Jupyter + gophernotes without installing anything using Docker. To run a Go notebook that only needs things from the standard library, run:
docker run -it -p 8888:8888 gopherdata/gophernotes
Or to run a Go notebook with access to common Go data science packages (gonum, gota, golearn, etc.), run:
docker run -it -p 8888:8888 gopherdata/gophernotes:latest-ds
In either case, running this command should output a link that you can follow to access Jupyter in a browser. Also, to save notebooks to and/or load notebooks from a location outside of the Docker image, you should utilize a volume mount. For example:
docker run -it -p 8888:8888 -v /path/to/local/notebooks:/path/to/notebooks/in/docker gopherdata/gophernotes
Getting Started
Jupyter
- If you completed one of the local installs above (i.e., not the Docker install), start the jupyter notebook server:
jupyter notebook
Select
Gofrom theNewdrop down menu.Have fun!
nteract
Launch nteract.
From the nteract menu select Language -> Go.
Have fun!
Special commands
In addition to Go code, the following special commands are also supported - they must be on a line by their own: - %cd [path] - %go111module {on|off} - %help - $ shell_command [args...]
Limitations
gophernotes uses gomacro under the hood to evaluate Go code interactively. You can evaluate most any Go code with gomacro, but there are some limitations, which are discussed in further detail here. Most notably, gophernotes does NOT support:
- importing third party packages when running natively on Windows - This is a current limitation of the Go
pluginpackage. - some corner cases on interpreted interfaces, as interface -> interface type switch and type assertion, are not implemented yet.
- some corner cases on recursive types may not work correctly.
- conversion from typed constant to interpreted interface is not implemented. Workaround: assign the constant to a variable, then convert the variable to the interpreted interface type.
- conversions from/to unsafe.Pointer are not supported.
- goto is only partially implemented.
- out-of-order code in the same cell is supported, but not heavily tested. It has some known limitations for composite literals.
Also, creation of new named types is emulated, and their methods are visible only to interpreted code.
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 ~/.local/share/jupyter/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:
sudo ln -s $HOME/go/bin/gophernotes /go/bin/gophernotes
Restart jupyter, and you should now be up and running.
error "could not import C (no metadata for C)" when importing a package
At a first analysis, it seems to be a limitation of the new import mechanism that supports Go modules.
You can switch the old (non module-aware) mechanism with the command %go111module off
To re-enable modules support, execute %go111module on
Look at Jupyter notebook's logs for debugging
In order to see the logs for your Jupyter notebook, use the --log-level option
jupyter notebook --log-level DEBUG
Owner
- Name: GopherData
- Login: gopherdata
- Kind: organization
- Location: #data-science on gophers slack
- Website: http://gopherdata.io
- Repositories: 3
- Profile: https://github.com/gopherdata
Bringing together users and developers of Go data management, processing, analytics, and visualization tools.
CodeMeta (codemeta.json)
{
"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
"@type": "Code",
"author": [],
"identifier": "",
"codeRepository": "https://github.com/gopherdata/gophernotes",
"datePublished": "2017-12-13",
"dateModified": "2017-12-13",
"dateCreated": "2017-12-13",
"description": "The Go kernel for Jupyter notebooks and nteract. ",
"keywords": "go, jupyter, nteract, golang, data science",
"license": "GPL v3.0",
"title": "gophernotes",
"version": "v1.0.0-RC"
}
GitHub Events
Total
- Watch event: 103
- Issue comment event: 1
- Fork event: 6
Last Year
- Watch event: 103
- Issue comment event: 1
- Fork event: 6
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel Whitenack | w****l@g****m | 157 |
| Massimiliano Ghilardi | m****i@g****m | 94 |
| SpencerPark | s****5@g****m | 27 |
| Sebastien Binet | b****t@c****h | 17 |
| Josh Cheek | j****k@g****m | 3 |
| Yasuhiro Matsumoto | m****p@g****m | 3 |
| kortschak | d****k@a****u | 3 |
| Dale Campbell | o****a@g****m | 2 |
| kgeneral | d****3@g****m | 1 |
| (repeatedly try) | d****n | 1 |
| Alexey Palazhchenko | a****o@g****m | 1 |
| Arfon Smith | a****n | 1 |
| Bobby Norton | b****y@t****m | 1 |
| Elliott Sales de Andrade | q****t@g****m | 1 |
| Francesc Campoy | c****y@g****g | 1 |
| Harry Moreno | m****9@g****m | 1 |
| Kevin Burke | k****v@i****m | 1 |
| Kyle Kizirian | k****n@g****m | 1 |
| Matthew Steffen | m****n@p****o | 1 |
| Michael Pratt | m****l@p****m | 1 |
| Miraç Gülgönül | m****6@g****m | 1 |
| Olalekan Oladipupo | l****0@g****m | 1 |
| Tabll | t****l@o****m | 1 |
| Thomas Kluyver | t****l@g****m | 1 |
| Vicente Cano | v****o@g****m | 1 |
| Yono Mittlefehldt | y****o@t****m | 1 |
| mackong | m****p@g****m | 1 |
| p1xt | P****t | 1 |
| yyang | w****j@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 92
- Total pull requests: 15
- Average time to close issues: 5 months
- Average time to close pull requests: 3 months
- Total issue authors: 65
- Total pull request authors: 11
- Average comments per issue: 4.47
- Average comments per pull request: 1.67
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cosmos72 (7)
- vsivsi (3)
- xdays (3)
- RafalSkolasinski (3)
- yutiansut (3)
- kortschak (3)
- codemicro (2)
- mogarg (2)
- 0xstepit (2)
- zishucom (2)
- encryptblockr (2)
- elamre (2)
- PhilipLutley (2)
- ave-nabulio (1)
- ChristianKniep (1)
Pull Request Authors
- sbinet (4)
- Oshuma (2)
- steele232 (1)
- DaruiShi (1)
- mlg556 (1)
- Tabll (1)
- kylekizirian (1)
- kgeneral (1)
- cosmos72 (1)
- mackong (1)
- lakexyde (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total docker downloads: 60
- Total dependent packages: 2
- Total dependent repositories: 2
- Total versions: 19
proxy.golang.org: github.com/gopherdata/gophernotes
- Homepage: https://github.com/gopherdata/gophernotes
- Documentation: https://pkg.go.dev/github.com/gopherdata/gophernotes#section-documentation
- License: MIT
-
Latest release: v0.7.5
published over 3 years ago
Rankings
Dependencies
- alpine 3.15 build
- github.com/cosmos72/gomacro 515faf9893ffc98ff66aab992cefbd8065aab308
- github.com/mattn/go-runewidth 9e777a8366cce605130a531d2cd6363d07ad7317
- github.com/pebbe/zmq4 90d69e412a09549f2e90bac70fbb449081f1e5c1
- github.com/peterh/liner 80ce870644db1b043e8dc2cf836bde5c347e2701
- github.com/satori/go.uuid 36e9d2ebbde5e3f13ab2e25625fd453271d6522e
- github.com/cosmos72/gomacro *
- github.com/pebbe/zmq4 *
- github.com/satori/go.uuid *
- github.com/cosmos72/gomacro v0.0.0-20220702114119-031290e3ea0e
- github.com/go-zeromq/zmq4 v0.15.0
- github.com/gofrs/uuid v4.4.0+incompatible
- golang.org/x/text v0.8.0
- github.com/cosmos72/gomacro v0.0.0-20220702114119-031290e3ea0e
- github.com/go-zeromq/goczmq/v4 v4.2.2
- github.com/go-zeromq/zmq4 v0.15.0
- github.com/gofrs/uuid v4.4.0+incompatible
- github.com/mattn/go-runewidth v0.0.3
- github.com/mattn/go-runewidth v0.0.13
- github.com/peterh/liner v1.2.2
- github.com/rivo/uniseg v0.2.0
- github.com/yuin/goldmark v1.4.1
- github.com/yuin/goldmark v1.4.13
- golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
- golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
- golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
- golang.org/x/mod v0.8.0
- golang.org/x/net v0.0.0-20190620200207-3b0461eec859
- golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
- golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b
- golang.org/x/net v0.6.0
- golang.org/x/sync v0.0.0-20190423024810-112230192c58
- golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
- golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
- golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
- golang.org/x/sync v0.1.0
- golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
- golang.org/x/sys v0.0.0-20201119102817-f84b799fce68
- golang.org/x/sys v0.0.0-20210423082822-04245dca01da
- golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
- golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
- golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1
- golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
- golang.org/x/sys v0.5.0
- golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
- golang.org/x/term v0.5.0
- golang.org/x/text v0.3.0
- golang.org/x/text v0.3.3
- golang.org/x/text v0.3.6
- golang.org/x/text v0.3.7
- golang.org/x/text v0.7.0
- golang.org/x/text v0.8.0
- golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
- golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e
- golang.org/x/tools v0.1.11
- golang.org/x/tools v0.1.12
- golang.org/x/tools v0.6.0
- golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7