Skip to content

Instantly share code, notes, and snippets.

@dmitry-mukhin
Created August 31, 2022 12:05
Show Gist options
  • Save dmitry-mukhin/e77a4dbc271f1243bff15c2f2a88c258 to your computer and use it in GitHub Desktop.
Save dmitry-mukhin/e77a4dbc271f1243bff15c2f2a88c258 to your computer and use it in GitHub Desktop.
Get all Uploadcare files in CVS
### Get all files stored in your Uploadcare project in CSV.
import pyuploadcare
import csv
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='public',
secret_key='secret')
files = uploadcare.list_files(stored=True)
with open('files.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
for file in files:
# customize what you want to have in the row
writer.writerow([file.uuid, file.cdn_url, file.filename, file.datetime_uploaded])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment