Get a list of file information from one of your buckets
from swan_mcs import APIClient, BucketAPI
mcs_api = APIClient("<API_KEY>")
bucket_client = BucketAPI(mcs_api)
for i in bucket_client.list_files("<BUCKET_NAME>", '<PREFIX>', "<LIMIT>", '<OFFSET>'):
print(i.to_json())
Get the file information of a file in one of your buckets
from swan_mcs import APIClient, BucketAPI
mcs_api = APIClient("<API_KEY>")
bucket_client = BucketAPI(mcs_api)
print(bucket_client.get_file("<BUCKET_NAME>", "<OBJECT_NAME>").to_json())
Parameters
- bucket_name: The name of the bucket
- object_name: The object name of the file
Downloads the file (located using bucket_name
/object_name
from IPFS and writes it to local_filename
from swan_mcs import APIClient, BucketAPI
mcs_api = APIClient("<API_KEY>")
bucket_client = BucketAPI(mcs_api)
bucket_client.download_file("<BUCKET_NAME>", "<OBJECT_NAME>", "<LOCAL_FILENAME>")
Parameters
- bucket_name: The name of the bucket
- object_name: The object name to download
- local_filename: The download destination and filename