jdanbrown / pydatalab

Google Datalab Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

datalab Build Status PyPI Package

Google Cloud Datalab Python package. Used in Google Cloud Datalab and can be used in Jupyter Notebook.

This adds a number of Python modules such as google.datalab.bigquery, google.datalab.storage, etc, for accessing Google Cloud Platform services as well as adding some new cell magics such as %chart, %bigquery, %storage, etc.

See https://github.com/googledatalab/notebooks for samples of using this package.

Installation

This package is available on PyPI as datalab:

pip install datalab

Using in Jupyter

In a notebook cell, enable with:

%load_ext datalab.kernel

Alternatively add this to your ipython_config.py file in your profile:

c = get_config()
c.InteractiveShellApp.extensions = [
    'datalab.kernel'
]

You will typically put this under ~/.ipython/profile_default. See the IPython docs for more about IPython profiles.

If you want to access Google Cloud Platform services such as BigQuery, you will also need to install gcloud. You will need to use gcloud to authenticate; e.g. with:

gcloud auth login

You will also need to set the project ID to use; either set a PROJECT_ID environment variable to the project name, or call set_datalab_project_id(name) from within your notebook.

Documentation

You can read the Sphinx generated docs at: http://googledatalab.github.io/pydatalab/

Development installation

If you'd like to work on the package, it's useful to be able to install from source. You will need the Typescript compiler installed.

First:

git clone https://github.com/googledatalab/pydatalab.git
cd pydatalab

Then do one of the folowing:

./install-virtualenv.sh  # For use in Python virtual environments
./install-no-virtualenv.sh  # For installing in a non-virtual environment

You can ignore the message about running jupyter nbextension enable; it is not required.

About

Google Datalab Library

License:Apache License 2.0


Languages

Language:Python 93.6%Language:TypeScript 5.8%Language:CSS 0.4%Language:Shell 0.2%