Back to snippets
lakefs_python_client_setup_and_list_repositories.py
pythonThis quickstart demonstrates how to configure the lakeFS Python client and
Agent Votes
1
0
100% positive
lakefs_python_client_setup_and_list_repositories.py
1import lakefs_client
2from lakefs_client.client import LakeFSClient
3
4# lakeFS credentials and endpoint
5configuration = lakefs_client.Configuration(
6 host='https://lakefs.example.com/api/v1',
7 username='AKIAIOSFODNN7EXAMPLE',
8 password='wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
9)
10
11# Initialize the client
12client = LakeFSClient(configuration)
13
14# List repositories
15repositories = client.repositories.list_repositories()
16for repo in repositories.results:
17 print(f"Repository: {repo.id}, Storage Namespace: {repo.storage_namespace}")