{"id":2092,"library":"lance-namespace-urllib3-client","title":"Lance Namespace urllib3 Client","description":"The `lance-namespace-urllib3-client` is an auto-generated Python client library for interacting with a Lance Namespace server, adhering to the Lance Namespace Specification. It provides methods for managing tables, including creation, declaration, and versioning operations. The current version is 0.6.1, and the library follows a rapid release cadence with frequent minor updates and bug fixes.","status":"active","version":"0.6.1","language":"en","source_language":"en","source_url":"https://github.com/lance-format/lance-namespace","tags":["lance","namespace","data","client","api","storage","urllib3"],"install":[{"cmd":"pip install lance-namespace-urllib3-client","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"Configuration","correct":"from lance_namespace_urllib3_client import Configuration"},{"symbol":"ApiClient","correct":"from lance_namespace_urllib3_client import ApiClient"},{"symbol":"ApiException","correct":"from lance_namespace_urllib3_client import ApiException"},{"note":"API classes are nested within `api.<api_name>_api` modules.","wrong":"from lance_namespace_urllib3_client.api import TableApi","symbol":"TableApi","correct":"from lance_namespace_urllib3_client.api.table_api import TableApi"},{"symbol":"TableCreation","correct":"from lance_namespace_urllib3_client.model.table_creation import TableCreation"},{"symbol":"Location","correct":"from lance_namespace_urllib3_client.model.location import Location"},{"symbol":"Name","correct":"from lance_namespace_urllib3_client.model.name import Name"}],"quickstart":{"code":"import os\nfrom pprint import pprint\n\nfrom lance_namespace_urllib3_client import Configuration, ApiClient, ApiException\nfrom lance_namespace_urllib3_client.api.table_api import TableApi\nfrom lance_namespace_urllib3_client.model.table_creation import TableCreation\nfrom lance_namespace_urllib3_client.model.location import Location\nfrom lance_namespace_urllib3_client.model.name import Name\n\n# Configure API client. Replace with your Lance Namespace server host.\n# You can also pass API keys for authentication if required by your server.\nconfiguration = Configuration(\n    host = os.environ.get('LANCE_NAMESPACE_HOST', 'http://localhost:8080')\n)\n# if os.environ.get('LANCE_API_KEY'):\n#     configuration.api_key['X-Api-Key'] = os.environ.get('LANCE_API_KEY')\n\n# Enter a context with an instance of the API client\nwith ApiClient(configuration) as api_client:\n    # Create an instance of the TableApi class\n    api_instance = TableApi(api_client)\n\n    # Define table details\n    table_name = Name('my_first_table')\n    table_creation_body = TableCreation(\n        location = Location(\n            uri=\"s3://my-test-bucket/data/my_first_table\", # Required: URI where table data is stored\n        ),\n        managed_versioning=True, # Enable or disable managed versioning for the table\n        properties={\n            \"owner\": \"data_team\",\n            \"environment\": \"dev\"\n        }\n    )\n\n    try:\n        # Call the declare_table API to register a new table\n        api_response = api_instance.declare_table(table_name, table_creation_body)\n        print(\"Successfully declared table:\")\n        pprint(api_response)\n    except ApiException as e:\n        print(f\"Exception when calling TableApi->declare_table: {e}\")\n\n# Example of retrieving a table\nwith ApiClient(configuration) as api_client:\n    api_instance = TableApi(api_client)\n    try:\n        get_table_response = api_instance.get_table(table_name)\n        print(\"\\nSuccessfully retrieved table:\")\n        pprint(get_table_response)\n    except ApiException as e:\n        print(f\"Exception when calling TableApi->get_table: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the client, configure its host, and declare a new table with `declare_table`. It also includes an example of retrieving the declared table using `get_table`. Remember to set the `LANCE_NAMESPACE_HOST` environment variable or modify the configuration directly to point to your Lance Namespace server."},"warnings":[{"fix":"Set `configuration.host = 'https://your-lance-namespace-server.com'` or use an environment variable (e.g., `LANCE_NAMESPACE_HOST`) to override the default during initialization.","message":"The default client host is `http://localhost:8080`. Users *must* configure the `host` parameter in `lance_namespace_urllib3_client.Configuration` to point to their actual Lance Namespace server endpoint, otherwise, all API calls will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure a Lance Namespace server is deployed and accessible at the configured host before making API calls.","message":"This client interacts with a Lance Namespace server. It does not provide the server itself. You need a running instance of a Lance Namespace server to use this client effectively.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If your Lance Namespace server requires authentication, uncomment and configure `configuration.api_key` or other auth methods as per your server's security policy.","message":"Authentication mechanisms (e.g., API keys, OAuth) are server-dependent. While the client supports common patterns like `api_key['X-Api-Key']`, it might not be enabled or required by default on your server setup. Consult your server's documentation for required authentication.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always review release notes for new versions to understand API changes and new capabilities, especially around features like table versioning and batch operations (e.g., `BatchCommitTables` in v0.6.0).","message":"The Lance Namespace specification and its clients are under active development. While explicit breaking changes are usually noted, the API can evolve. Features like `managed_versioning` (introduced in v0.5.0) reflect ongoing enhancements.","severity":"deprecated","affected_versions":"Before v0.5.0"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}