{"id":2980,"library":"lakefs-sdk","title":"lakeFS SDK","description":"The `lakefs-sdk` is the low-level Python client for interacting with the lakeFS API. It provides direct access based on the OpenAPI specification, offering full control over API interactions. It is distinct from the higher-level `lakefs` SDK, which provides a more Pythonic interface for common operations. The library is actively maintained with frequent releases, currently at version 1.80.0.","status":"active","version":"1.80.0","language":"en","source_language":"en","source_url":"https://github.com/treeverse/lakeFS/tree/master/clients/python","tags":["data versioning","data lake","API client","ETL","data engineering","version control"],"install":[{"cmd":"pip install lakefs-sdk","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required runtime environment","package":"Python","version":">=3.7"}],"imports":[{"note":"Used to configure the API client with host and credentials.","symbol":"Configuration","correct":"from lakefs_sdk import Configuration"},{"note":"Initializes the API client using the configured settings.","symbol":"ApiClient","correct":"from lakefs_sdk import ApiClient"},{"note":"Example for accessing repository-related API endpoints. Other API groups (e.g., `BranchesApi`, `ObjectsApi`) are accessed similarly.","symbol":"RepositoriesApi","correct":"from lakefs_sdk.apis import RepositoriesApi"},{"note":"Common exception class for API errors.","symbol":"ApiException","correct":"from lakefs_sdk.rest import ApiException"},{"note":"The `lakefs-client` package is deprecated and no longer supported for new updates or features. Migrate to `lakefs-sdk` for low-level access or `lakefs` for high-level operations.","wrong":"import lakefs_client","symbol":"lakefs_client","correct":"from lakefs_sdk import Configuration, ApiClient"}],"quickstart":{"code":"import os\nimport lakefs_sdk\nfrom lakefs_sdk.apis import RepositoriesApi\nfrom lakefs_sdk.rest import ApiException\n\n# Configure API client with credentials from environment variables\nconfiguration = lakefs_sdk.Configuration(\n    host=os.environ.get('LAKEFS_SERVER_ENDPOINT_URL', 'https://example.lakefs.io/api/v1'),\n    username=os.environ.get('LAKEFS_ACCESS_KEY_ID', ''),\n    password=os.environ.get('LAKEFS_SECRET_ACCESS_KEY', '')\n)\n\n# Create an API client instance\nwith lakefs_sdk.ApiClient(configuration) as api_client:\n    # Create an instance of the Repositories API\n    repositories_api = RepositoriesApi(api_client)\n\n    try:\n        # List repositories\n        repos = repositories_api.list_repositories()\n        print(\"Successfully connected to lakeFS!\")\n        print(\"Repositories:\")\n        for repo in repos.results:\n            print(f\"- {repo.id}\")\n    except ApiException as e:\n        print(f\"Error connecting to lakeFS or listing repositories: {e}\")\n        print(\"Ensure LAKEFS_SERVER_ENDPOINT_URL, LAKEFS_ACCESS_KEY_ID, and LAKEFS_SECRET_ACCESS_KEY are set.\")\n","lang":"python","description":"This quickstart demonstrates how to configure the `lakefs-sdk` client using environment variables and then list all available repositories. Ensure `LAKEFS_SERVER_ENDPOINT_URL`, `LAKEFS_ACCESS_KEY_ID`, and `LAKEFS_SECRET_ACCESS_KEY` are set in your environment."},"warnings":[{"fix":"Replace `lakefs-client` imports and usage with `lakefs_sdk` or `lakefs`. Refer to the 'Migrating to 1.0' guide for specific code changes.","message":"The `lakefs-client` package is deprecated as of lakeFS 1.0 (last release v1.44.0) and is no longer supported for new updates or features. Users should migrate to `lakefs-sdk` (for low-level API access) or the higher-level `lakefs` package.","severity":"breaking","affected_versions":"<=1.44.0 (lakefs-client)"},{"fix":"For most common lakeFS operations, the `lakefs` (high-level) SDK is recommended for its simpler interface. Use `lakefs-sdk` when you need full control over API requests or features not exposed by the high-level SDK.","message":"There are two main Python SDKs for lakeFS: `lakefs-sdk` (low-level, auto-generated, direct API calls) and `lakefs` (high-level, Pythonic interface for common operations like branches, commits, objects, transactions). Choosing the wrong SDK can lead to more complex code than necessary for common tasks.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update import paths (e.g., `lakefs_client.model` to `lakefs_sdk.models`, `lakefs_client.apis` to `lakefs_sdk.apis`) and adapt result parsing to use direct object attributes instead of `get_property`.","message":"Migrating to lakeFS 1.0 and the `lakefs-sdk` from older `lakefs-client` versions involved API changes, such as renaming the `model` module to `models` and `apis` to `api`. Also, fetching results from response objects changed from dictionary-like access (`get_property`) to direct attribute access (`prop_name`).","severity":"breaking","affected_versions":"Migrations from lakefs-client <1.0 to lakefs-sdk >=1.0"},{"fix":"Always explicitly pass `host`, `username`, and `password` to `lakefs_sdk.Configuration`. Use `os.environ.get()` to read credentials from environment variables if desired.","message":"The `lakefs-sdk` requires explicit configuration of host and credentials. Unlike the higher-level `lakefs` SDK, it does not automatically infer identity from environment variables (`LAKEFS_ACCESS_KEY_ID`, `LAKEFS_SECRET_ACCESS_KEY`, `LAKEFS_SERVER_ENDPOINT_URL`) or a local `.lakectl.yaml` file without explicit handling.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the latest lakeFS documentation on 'Short-Lived Tokens (STS)' and 'Authentication' for current recommended patterns for SSO and temporary credential usage.","message":"OpenID Connect (OIDC) support for authentication via older configuration methods is deprecated. For single sign-on (SSO) or short-lived token (STS-like) authentication, users should consider lakeFS Cloud or Enterprise features.","severity":"deprecated","affected_versions":"All versions where OIDC was previously configurable"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}