Skip to main content

Google Colab

Arraylake works great with Google Colab, a free, hosted Jupyter Notebook service.

Configure Secrets

Because Colab does not offer command line (terminal) access, you must use Service Account API Tokens to authenticate with Arraylake.

Once you have an Arraylake API token set up, store it in the Colab Secrets Manager. You can call it whatever you like. In this example, I will use ARRAYLAKE_TOKEN.

You should also set up credential to talk to your object store. If you're using AWS S3, that means setting both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

When you're finished setting these secrets, your secrets tab should look like this:

Colab Secrets

Use Arraylake from a Notebook

Install Arraylake

You'll need to pip install Arraylake in your notebook.

! pip install arraylake

Configure Client

To use your secrets in your notebook, you'll want to configure Arraylake as follows:

from google.colab import userdata

from arraylake import Client, config

config.set({
"s3.aws_access_key_id": userdata.get('AWS_ACCESS_KEY_ID'),
"s3.aws_secret_access_key": userdata.get('AWS_SECRET_ACCESS_KEY'),
"token": userdata.get('ARRAYLAKE_TOKEN')
})
client = Client()

From here, you can interact with Arraylake to read and write data! 🎉