kota7 / colab-preamble

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

COLAB PREAMBLE

Prepare google colaboratory by one line of command

Installation

# from pypi
$ pip install colab-preamble

# alternatively, from github
$ git clone https://github.com/kota7/colab-preamble --depth 1
$ pip install -U ./colab-preamble

Example

Example colab notebook is here: colab-preamble-example.ipynb

Usage

import colab_preamble

colab_preamble_run(google_cloud_project="<project-id>", mount_drive=True)
# If no need to access google cloud services, no need to provide set google_cloud_project=None
# If no need to mount google drive, set mount_drive=False

Effect

When google_cloud_project is given,

  • Set the default project ID
    • Run gcloud config set ...
    • Set GOOGLE_CLOUD_PROJECT environment variable
  • Open the authentication prompt
  • Introduce bigquery magic command bq

When mount_drive is true,

  • Open the prompt and mount the google drive at '/content/drive'

About

License:MIT License


Languages

Language:Python 100.0%