menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Frame.io Developers

Frame.io is a video review and collaboration platform. Share video projects with your team and clients for fast feedback and approval. Use Frame.io's API to add custom features to your workflow!

Channels
Team

How to get children only folder type by python api

May 24, 2021 at 7:28am

How to get children only folder type by python api

May 24, 2021 at 7:28am (Edited 8 months ago)
I find how to get assets's children.
I also read frameio developer docs.
client.assets.get_children('asset_id', type='folder')
I run this code.
But I got all folder & files.
I want only folders.
Or search by name. Like this.
client.assets.get_children('asset_id', name='folder_name')
How to use 'get_children' function kwargs?

June 8, 2021 at 1:03am
It is not possible using our API to just return files vs folders using the endpoint: /v2/assets/:id/children. The ?include=review_links or ?include=cover_asset is only additive, and does not allow you to specify which you'd like returned.
The kwargs for get_children() was actually a mistake on my part and should not have been there, and will not do anything right now. I am however fixing this as we speak and will make sure to let you know when this is fixed! Thank you for bringing this to our attention :).
Edited
If you want to search using our API, you need to use our search endpoint, which is documented here - https://developer.frame.io/docs/workflows-assets/search-for-assets. We don't currently have Search in the Python SDK, in part because constructing those queries is pretty messy, however I have started working on adding it.
Edited
Here's my PR to add support for Search!