When interacting with objects in lakeFS using boto...
# help
b
When interacting with objects in lakeFS using boto, is there a way to commit to LakeFS using the python lakefs SDK?
i
Hey Bill, Yes, here's a short example:
Copy code
from lakefs_client import LakeFSClient
from lakefs_client.models import CommitCreation

# Initialize the lakeFS client
client = LakeFSClient(
    configuration={
        "host": "<http://lakefs.example.com/api/v1|http://lakefs.example.com/api/v1>",
        "access_key": "YOUR_ACCESS_KEY",
        "secret_key": "YOUR_SECRET_KEY"
    }
)

# Specify the repository and branch you've been working on
repository_name = 'your-repository'
branch_name = 'your-branch'

# Create a commit with the changes
commit_response = client.commits.commit(
    repository=repository_name,
    branch=branch_name,
    commit_creation=CommitCreation(
        message="Describe the changes you made",
        metadata={"key": "value"}  # Optional additional metadata about the commit
    )
)
lakefs 1
b
Thank you!
lakefs 1
i
One last thing, You can also use the high-level Python SDK, which should provide a smoother experience.