Created
August 31, 2022 12:05
-
-
Save dmitry-mukhin/e77a4dbc271f1243bff15c2f2a88c258 to your computer and use it in GitHub Desktop.
Get all Uploadcare files in CVS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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