petrel-oss-python-sdk2 / tests /file_iterator_test.py
Weiyun1025's picture
Upload folder using huggingface_hub
2abfccb verified
raw
history blame
809 Bytes
from petrel_client.client import Client
c = Client(conf_path='../conf/petreloss.conf')
data = c.get('cluster1:s3://lili1.test2/sometest')
print (data)
c.put('s3://lili1.test2/sometest', 'sometest')
files = c.get_file_iterator('s3://lili1.test2/test3')
files1 = c.get_file_iterator('s3://lili1.test2')
files2 = c.get_file_iterator('cluster1:s3://lili1.test2/')
cluster = 'cluster1'
for path, key in files:
k = '{0}:s3://{1}'.format(cluster, path)
print (k)
#c.get(k)
print ('='*20)
for path, key in files:
k = '{0}:s3://{1}'.format(cluster, path)
print (k)
#c.get(k)
print ('='*20)
for path, key in files:
k = '{0}:s3://{1}'.format(cluster, path)
print (k)
#c.get(k)
for path, key in files1:
print (path, key)
for path, key in files2:
print (path, key)