Search code examples
google-cloud-datalab

APIs for google datalab


I have a (maybe stupid) question: once I have created a program using google datalab's notebook can this program be called from an external script through APIs? Actually it is the only thing that I could not understand of this product.

Thanks in advance


Solution

  • If you have installed datalab locally, you could use jupyter nbconvert to execute your notebook from an external script. Here is a working example:

    jupyter nbconvert --to python --execute <notebook.ipynb>

    You will need to run this command inside the datalab docker container.

    • Type docker ps to get the id of the datalab container
    • Type docker exec -t -i <docker container id> /bin/bash to run a command inside the datalab docker container