Hey there, I will preface this by saying i am not experienced at all with programming and have basically used AI chatbots to help me put all of this together. My goal is to recursively sync all my frame.io projects by downloading them to a local volume. The approach I have tried to take is using my Teams ID to list all projects for my team, then print those project ID’s and feed them through the Projects “download” attribute listed in the SDK documentation. Yet for some reason, when i run this code:
import os
import logging
from frameioclient import FrameioClient
Frame.io Configuration
FRAMEIO_TOKEN = “fio-xxx”
TEAM_ID = “xxxx”
DOWNLOAD_DIRECTORY = ‘/Volumes/xxx’ # Set your desired download directory
Logging Setup (Optional but recommended for debugging)
logging.basicConfig(level=logging.INFO, format=‘%(asctime)s - %(levelname)s - %(message)s’)
def main():
client = FrameioClient(FRAMEIO_TOKEN)
try:
# Fetch all projects under the team
projects = client.teams.list_projects(TEAM_ID)
if not projects:
logging.warning("No projects found for this team.")
return
# Print project IDs and download each project
for project in projects:
project_id = project['id']
project_name = project['name']
logging.info(f"Found project: {project_name} (ID: {project_id})")
destination_path = os.path.join(DOWNLOAD_DIRECTORY, project_name)
os.makedirs(destination_path, exist_ok=True) # Create the project directory if it doesn't exist
client.projects.download(project_id, destination_path)
logging.info(f"Downloaded project: {project_name} to {destination_path}")
except Exception as e:
logging.error(f"An error occurred: {e}")
if name == “main”:
main()
It keeps returning this error, saying the download attribute does not exist for Projects class, even though the SDK documentation i attached shows it does: soundbyte@PTC-ANDROMEDA FrameIOTOFilecloud % /usr/local/bin/python3 /Users/soundbyte/Desktop/FrameIOTOFilecloud/frameiosync_070224.py
2024-07-02 13:23:20,989 - INFO - Found project: BLUE OX FILMS (ID: 3e1dd7d7-e4f5-40a6-8daa-1bf719f9c23a)
2024-07-02 13:23:20,993 - ERROR - An error occurred: ‘Project’ object has no attribute ‘download’
One thing to note, I did very slightly change the FrameIOClient’s client.py file because it wasn’t working with my version of python (3.12.3) , the only thing i changed was i made this line: method_whitelist=[“POST”, “OPTIONS”, “GET”]
into: allowed_methods=[“POST”, “OPTIONS”, “GET”]