The comment scraper will retrieve all Assets in a Project, scrape the Comments, and output them in a .csv file. This walkthrough uses the following resources:
Glitch is a simple tool allows you to set up your own applications and test and run them using their servers. If you’re not familiar with Glitch, check out our guide on Using Glitch.
If you want to see the comment scraper work on a server, we have a Flask app set up on Glitch: Frame.io Comment Scraper in Python.
Before beginning this guide, you’ll need to make sure you have a token that includes at least the following scopes:
This guide will follow a similar pattern as Reading the File Tree — accordingly, to get started, you’ll need:
root_asset_id of the Project you’re crawlingYou’ll also want to import the FrameioClient into your Python app, as well as some additional helper libraries:
Now, you’ll need to recursively retrieve all Assets, check them for Comments, and stash any Commented Assets in list from which you can construct your .csv file.
As you crawl through your Project, you’ll need to make the following checks on each Asset:
"_type": "file").
"_type": "folder")
"_type": "version_stack")
The example above ignores pagination — but as you navigate through large collections, you shouldn’t! See our Key Concepts guide for reference.
Unless you handled this during your crawl, you’ll want to flatten out your list for easier processing.
When your list is flat, you can use list comprehension to grab the elements from each comment that you think are useful, and then output them into a .csv file. We recommend at least having:
textparent_idasset_idnameowner_idowner.emailtimestampupdated_atWhen you’ve made a new list containing the output you want per asset for your final output, it’s time to write to your .csv file.
And that’s it! You now have a .csv file with the flattened Comments from an entire Frame.io Project.