Quickstart: Neptyne in Google Sheets

This tutorial shows you how to get quickly up and running with Neptyne in Google Sheets. You'll need access to Google Sheets and the Neptyne Add-on, of course, but once you have that, it shouldn't take you more than 5 minutes to have your first Python code up and running in Google Sheets.

To begin, install the Neptyne: Python for Google Sheets extension, then return here.

Follow the steps below to start using it:

  • Create a new Google Sheet
  • In the toolbar on your sheet, click Extensions > Neptyne: Python for Sheets > Show Code Editor

    Note: It may take a minute or two for the extension to appear here. Try refreshing the page if it doesn't.
  • Paste this python function into your editor on the top of the sidebar
def say_hello(to_who):
    return "hello " + (to_who or "world")
  • In the Python REPL at the bottom of the sidebar, test your function by typing: say_hello("world")
  • In A1, put the value world
  • Now, we will use Neptyne's PY formula to call our Python function say_hello on the value in A1
  • In B1’s formula, type: =PY("say_hello", A1)
  • Change A1 to universe, and notice that B1 re-executes!

Congratulations! You're now you've now integrated Python with your spreadsheet!
Continue to The Magic of Spilling to build your first application!