Creating records via Python - attachment URLs

Good morning, Airtable Community! I am getting into some Python automation scripts and working with Airtable for the first time (translation: relative n00b all around).

I am looking to programmatically create a couple hundred records at a time, and each record has a thumbnail JPEG image that I want to include as a Screenshot attachment. I understand that Airtable requires a URL to the JPEG rather than a path to the local file, but so far all of the cloud storage options that I have at my disposal (well, both - Google Drive and Dropbox) construct a unique URL with a long string of arbitrary characters that I don’t yet have access to in my script.

My question - how do you smarter folks accomplish this, is there a scriptable step that I am missing? OR, is there a service or trick that I can use to make a consistent, identifiable URL (i.e. http://somestorage.com/SameNameAsTheLocalFile.jpg")?

Thanks for any further insight that any of you can provide!
Steve

Yes. It is the step that accesses the cloud file store and provides the URL-based [public] location of the file.

Doing this in Python with Google Drive requires you use the Google Drive API. If, alternatively, you were automating this process with Google Apps Script, the native SDK would give you very easy access to Drive.

Thanks, Bill, I’ll turn my sights on the Google Drive python API and see what happens.

Best,
Steve

You could also look at Cloudinary. It has a predictable method of creating urls for the images that it serves.

1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.