lakeFS Python Client (Legacy/Deprecated)

1.44.0 · deprecated · verified Thu Apr 16

This is the legacy Python client for lakeFS, an open-source data version control system. It provides direct access to the lakeFS HTTP API, automatically generated from an OpenAPI specification. As of its last release, v1.44.0, this client has reached End-of-Life (EOL) and is officially deprecated. Users are strongly advised to migrate to the newer `lakefs-sdk` (for direct API access) or `lakefs` (for a higher-level, more Pythonic interface) packages.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to configure the legacy `lakefs-client` and list existing repositories. It uses environment variables for host and credentials, falling back to placeholders if not set. Due to the client's deprecated status, this example serves mostly for understanding the legacy API structure.

import os
import lakefs_client
from lakefs_client.api import repositories_api

# Configure HTTP basic authorization (replace with your lakeFS endpoint and credentials)
configuration = lakefs_client.Configuration(
    host=os.environ.get('LAKEFS_ENDPOINT', 'http://localhost/api/v1'),
    username=os.environ.get('LAKEFS_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY_ID'),
    password=os.environ.get('LAKEFS_SECRET_ACCESS_KEY', 'YOUR_SECRET_ACCESS_KEY')
)

# Create an instance of the API class
api_client = lakefs_client.ApiClient(configuration)
api_instance = repositories_api.RepositoriesApi(api_client)

try:
    # List repositories
    repos = api_instance.list_repositories()
    print("Existing Repositories:")
    for repo in repos.results:
        print(f"- {repo.id}")
except lakefs_client.ApiException as e:
    print(f"Exception when calling RepositoriesApi->list_repositories: {e}")
    print("Make sure your lakeFS server is running and credentials are correct.")

view raw JSON →