def finalize_project_action(**kwargs):
    project_data = file_utils.read_from_project_file() or {}
    video_id = ''.join(project_data.keys()) if len(project_data) == 1 else None
    act = kwargs.get('project')
    if act.startswith(('render', 'close')):
        close()
    prompt.show_project_action_success(act, video_id, kwargs.get('profile_name'))
def get_project_api(profile, **kwargs):
    api = pv_cli_utils.prepare_api_object(profile_name=profile, session=True)
    video_id = kwargs.get('video', None)
    project_data = file_utils.read_from_project_file() or {}
    if not video_id:
        video_id = ''.join(project_data.keys()) if len(project_data) == 1 else None
    data = project_data.get(video_id, None)
    api.project.video = video_id
    if data:
        populate_vdd_to_project(api.project, data)
    return api