Skip to main content

client

The Client module contains the main classes used to interact with the Arraylake service. For asyncio interaction, use the AsyncClient. For regular, non-async interaction, use the Client.

Example usage:

from arraylake import Client
client = Client()
repo = client.get_repo("my-org/my-repo")

AsyncClient

Asyncio Client for interacting with ArrayLake

Arguments:

service_uri: [Optional] The service URI to target. token: [Optional] API token for service account authentication. auth_org: [Optional] If not provided, tries to get this from user.org in the config.

list_repos

async def list_repos(org: str) -> Sequence[RepoModel]

List all repositories for the specified org

Arguments:

  • org - Name of the org

get_repo_object

async def get_repo_object(name: str) -> RepoModel

Get the repo configuration object.

See get_repo for an instantiated repo.

Arguments:

  • name - Full name of the repo (of the form [ORG]/[REPO])

get_repo

async def get_repo(
name: str,
*,
checkout: Optional[bool] = None,
read_only: bool = False) -> repo_v1.AsyncRepo | IcechunkStore

Get a repo by name

Arguments:

name: Full name of the repo (of the form [ORG]/[REPO]) checkout: Automatically checkout the repo after instantiation. Defaults to True for V1 repos and False for icechunk repos. read_only: Open the repo in read-only mode.

Returns:

A V1 AsyncRepo object or an IcechunkStore object.

get_or_create_repo

async def get_or_create_repo(
name: str,
*,
checkout: Optional[bool] = None,
bucket_config_nickname: Optional[str] = None,
kind: Optional[RepoKind] = None,
prefix: Optional[str] = None) -> repo_v1.AsyncRepo | IcechunkStore

Get a repo by name. Create the repo if it doesn't already exist.

Arguments:

name: Full name of the repo (of the form [ORG]/[REPO]) checkout: Whether to checkout the repo after instantiation. If the repo does not exist, checkout is ignored. Ignored if specified for a Icechunk repo. bucket_config_nickname: The created repo will use this bucket for its chunks. If the repo exists, bucket_config_nickname is ignored. kind: The kind of repo to get or create e.g. Arraylake V1 or Icechunk V2 prefix: Optional prefix for Icechunk store. Only used for Icechunk V2 repos. If not provided, the repo ID will be used.

Returns:

A V1 AsyncRepo object or IcechunkStore

create_repo

async def create_repo(
name: str,
*,
bucket_config_nickname: Optional[str] = None,
kind: Optional[RepoKind] = None,
prefix: Optional[str] = None) -> repo_v1.AsyncRepo | IcechunkStore

Create a new repo

Arguments:

name: Full name of the repo to create (of the form [ORG]/[REPO]) bucket_config_nickname: An optional bucket to use for the chunkstore kind: The kind of repo to get or create e.g. Arraylake V1 or Icechunk V2 prefix: Optional prefix for Icechunk store. Only used for Icechunk V2 repos. If not provided, the repo ID will be used.

delete_repo

async def delete_repo(name: str,
*,
imsure: bool = False,
imreallysure: bool = False) -> None

Delete a repo

Arguments:

  • name - Full name of the repo to delete (of the form [ORG]/[REPO]) imsure, imreallysure: confirm you intend to delete this bucket config

create_bucket_config

async def create_bucket_config(
*,
org: str,
nickname: str,
uri: str,
extra_config: dict | None = None,
auth_config: dict | None = None) -> BucketResponse

Create a new bucket config entry

NOTE: This does not create any actual buckets in the object store.

Arguments:

  • org - Name of the org
  • nickname - bucket nickname (example: ours3-bucket`)
  • uri - The URI of the object store, of the form platform://bucket_name[/prefix].
  • extra_config - dictionary of additional config to set on bucket config
  • auth_config - dictionary of auth parameters, must include "method" key, default is {"method": "anonymous"}

set_default_bucket_config

async def set_default_bucket_config(*, org: str, nickname: str) -> None

Set the organization's default bucket for any new repos

Arguments:

  • nickname - Nickname of the bucket config to set as default.

get_bucket_config

async def get_bucket_config(*, org: str, nickname: str) -> BucketResponse

Get a bucket's configuration

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket config to retrieve.

list_bucket_configs

async def list_bucket_configs(org: str) -> list[BucketResponse]

List all bucket config entries

Arguments:

  • org - Name of the organization.

list_repos_for_bucket_config

async def list_repos_for_bucket_config(*, org: str,
nickname: str) -> list[RepoModel]

List repos using a given bucket

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket configuration.

delete_bucket_config

async def delete_bucket_config(*,
org: str,
nickname: str,
imsure: bool = False,
imreallysure: bool = False) -> None

Delete a bucket config entry

NOTE: If a bucket config is in use by one or more repos, it cannot be deleted. This does not actually delete any buckets in the object store.

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket config to delete. imsure, imreallysure: confirm you intend to delete this bucket config

login

async def login(*, org: str | None = None, browser: bool = False) -> None

Login to ArrayLake

Arguments:

  • org - Name of the org (only required if your default organization uses SSO)
  • browser - if True, open the browser to the login page

logout

async def logout(*, org: str | None = None, browser: bool = False) -> None

Log out of ArrayLake

Arguments:

  • org - Name of the org (only required if your default organization uses SSO)
  • browser - if True, open the browser to the logout page

Client

Client for interacting with ArrayLake.

Arguments:

  • service_uri str - [Optional] The service URI to target.
  • token str - [Optional] API token for service account authentication.

list_repos

def list_repos(org: str) -> Sequence[RepoModel]

List all repositories for the specified org

Arguments:

  • org - Name of the org

get_repo

def get_repo(name: str,
*,
checkout: Optional[bool] = None,
read_only: bool = False) -> repo_v1.Repo | IcechunkStore

Get a repo by name

Arguments:

name: Full name of the repo (of the form [ORG]/[REPO]) checkout: Automatically checkout the repo after instantiation. Ignored if specified for a Icechunk repo. read_only: Open the repo in read-only mode.

get_or_create_repo

def get_or_create_repo(
name: str,
*,
checkout: Optional[bool] = None,
bucket_config_nickname: Optional[str] = None,
kind: Optional[RepoKind] = None,
prefix: Optional[str] = None) -> repo_v1.Repo | IcechunkStore

Get a repo by name. Create the repo if it doesn't already exist.

Arguments:

name: Full name of the repo (of the form [ORG]/[REPO]) checkout: Whether to checkout the repo after instantiation. If the repo does not exist, checkout is ignored. Ignored if specified for a Icechunk repo. bucket_config_nickname: The created repo will use this bucket for its chunks. If the repo exists, bucket_config_nickname is ignored. kind: The kind of repo to get or create e.g. Arraylake V1 or Icechunk V2 prefix: Optional prefix for Icechunk store. Only used for Icechunk repos. If not provided, the repo ID will be used.

create_repo

def create_repo(
name: str,
*,
bucket_config_nickname: Optional[str] = None,
kind: Optional[RepoKind] = None) -> repo_v1.Repo | IcechunkStore

Create a new repo

Arguments:

  • name - Full name of the repo to create (of the form [ORG]/[REPO])
  • bucket_config_nickname - An optional bucket to use for the chunkstore
  • kind - the kind of repo to create (v1 or icechunk)

delete_repo

def delete_repo(name: str,
*,
imsure: bool = False,
imreallysure: bool = False) -> None

Delete a repo

Arguments:

  • name - Full name of the repo to delete (of the form [ORG]/[REPO])

create_bucket_config

def create_bucket_config(*,
org: str,
nickname: str,
uri: str,
extra_config: dict | None = None,
auth_config: dict | None = None) -> BucketResponse

Create a new bucket config entry

NOTE: This does not create any actual buckets in the object store.

Arguments:

  • org - Name of the org
  • nickname - bucket nickname (example: our-s3-bucket)
  • uri - The URI of the object store, of the form platform://bucket_name[/prefix].
  • extra_config - dictionary of additional config to set on bucket config
  • auth_config - dictionary of auth parameters, must include "method" key, default is {"method": "anonymous"}

set_default_bucket_config

def set_default_bucket_config(*, org: str, nickname: str) -> None

Set the organization's default bucket config for any new repos

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket config to set as default.

get_bucket_config

def get_bucket_config(*, org: str, nickname: str) -> BucketResponse

Get a bucket's configuration

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket config to retrieve.

list_bucket_configs

def list_bucket_configs(org: str) -> list[BucketResponse]

List all buckets for the specified org

Arguments:

  • org - Name of the org

list_repos_for_bucket_config

def list_repos_for_bucket_config(
*, org: str, nickname: str) -> list[repo_v1.Repo | IcechunkStore]

List repos using a given bucket config

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket.

delete_bucket_config

def delete_bucket_config(*,
org: str,
nickname: str,
imsure: bool = False,
imreallysure: bool = False) -> None

Delete a bucket config entry

NOTE: If a bucket config is in use by one or more repos, it cannot be deleted. This does not actually delete any buckets in the object store.

Arguments:

  • org - Name of the org
  • nickname - Nickname of the bucket config to delete. imsure, imreallysure: confirm you intend to delete this bucket config

login

def login(*, org: str | None = None, browser: bool = False) -> None

Login to ArrayLake

Arguments:

  • org - Name of the org (only required if your default organization uses SSO)
  • browser - if True, open the browser to the login page

logout

def logout(*, org: str | None = None, browser: bool = False) -> None

Log out of ArrayLake

Arguments:

  • org - Name of the org (only required if your default organization uses SSO)
  • browser - if True, open the browser to the logout page