Skip to main content

Official Python SDK for Altertable Lakehouse API

Project description

Altertable Lakehouse Python SDK

Official Python SDK for the Altertable Lakehouse API.

Installation

pip install altertable-lakehouse

Usage

Initialization

from altertable_lakehouse import Client

client = Client(username="your_username", password="your_password")

Querying

from altertable_lakehouse.models import QueryRequest

# Stream rows (good for large datasets)
req = QueryRequest(statement="SELECT * FROM my_table")
metadata, row_iterator = client.query(req)
for row in row_iterator:
    print(row)

# Accumulate all rows in memory
result = client.query_all(req)
print(result.rows)

Append

res = client.append(catalog="my_cat", schema="my_schema", table="my_table", data={"col1": "val1"})
print(res.ok)

Upload

from altertable_lakehouse.models import UploadFormat, UploadMode

with open("data.csv", "rb") as f:
    client.upload(
        catalog="my_cat", 
        schema="my_schema", 
        table="my_table", 
        format=UploadFormat.CSV, 
        mode=UploadMode.APPEND, 
        content=f.read()
    )

Validate Query

res = client.validate("SELECT * FROM non_existent")
print(res.valid)
print(res.connections_errors)

Query Log & Cancellation

# Get query status
log_res = client.get_query("query_uuid_here")
print(log_res.progress)

# Cancel a query
cancel_res = client.cancel_query("query_uuid_here", "session_id_here")
print(cancel_res.cancelled)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

altertable_lakehouse-0.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

altertable_lakehouse-0.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file altertable_lakehouse-0.2.0.tar.gz.

File metadata

  • Download URL: altertable_lakehouse-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for altertable_lakehouse-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f4c17074b338b93d7d62de092d0c8c928be558afb349835f5353c5e57f250dcd
MD5 82dc8fa753d7ccede41b582acfab0548
BLAKE2b-256 3ab2b4082b87a175e01cebc3ce3713bdbbca0c2b751e91457802c6377dab8405

See more details on using hashes here.

Provenance

The following attestation bundles were made for altertable_lakehouse-0.2.0.tar.gz:

Publisher: release-please.yml on altertable-ai/altertable-lakehouse-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file altertable_lakehouse-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for altertable_lakehouse-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3d9580b0db919e113b679295f8c5c5d58ef2a4471d8bb66d701039c5d68953c
MD5 41ca86de04b255c1ac637a74988bd8b1
BLAKE2b-256 2e651d2d55e17993b2009054ca2601870d4d29d6e71d5a08b741749abd8c066f

See more details on using hashes here.

Provenance

The following attestation bundles were made for altertable_lakehouse-0.2.0-py3-none-any.whl:

Publisher: release-please.yml on altertable-ai/altertable-lakehouse-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page