```import lakefs_client from lakefs_client import ...
# help
b
Copy code
import lakefs_client
from lakefs_client import models
from lakefs_client.client import LakeFSClient

# lakeFS credentials and endpoint
configuration = lakefs_client.Configuration()
configuration.username = '<lakefs user key>'
configuration.password = '<lakefs secret>'
configuration.host = '<lakefs endpoint url>'

client = LakeFSClient(configuration)
data = client.objects.get_object(repository='<repository>', ref='<branch or reference>', path='<path to file>').read()
print(data)
r
Hi @Barak Amar Thanks a lot for your quick solution. 🙂
Hi @Barak Amar one question, can we read multiple file under one lakeFS branch/directory. Scenario is, we have multiple file under one directory , we need to read all at once. Can we do it in python ?
g
Hi @Rahul Kumar, There is no specific command for reading all objects under one directory. In order to read multiple files under a directory you will first need to list them using the
list_objects
command, then you could read them using the
get_object
command.
For more detailed information about the python client, with all possible commands with examples, checkout the python client README file