email = input('Enter email: ') password = getpass.getpass() project_id = input('Enter project id: ') with open('./conf/new_users.yml', 'r') as f: configuration = yaml.safe_load(f) users = configuration['users'] DEFAULT_ORGANIZATION_ROLE = 'USER' kauth = KiliAuth(email, password) playground = Playground(kauth) organization_id = playground.get_user(email=email)['organization']['id'] for user in tqdm(users): user_name = get(user, 'name') user_email = get(user, 'email') user_password = get(user, 'password') playground.create_user(name=user_name, email=user_email, password=user_password, organization_id=organization_id, organization_role=DEFAULT_ORGANIZATION_ROLE) user_role = get(user, 'role') playground.append_to_roles(project_id=project_id, user_email=user_email, role=user_role)
}, "JOB_1": { "mlTask": "TRANSCRIPTION", "instruction": "Transcription of A", "required": 1, "isChild": True }, "JOB_2": { "mlTask": "TRANSCRIPTION", "instruction": "Transcription of B", "required": 1, "isChild": True } } } user_id = playground.auth.user_id project = playground.create_empty_project(user_id=user_id) playground.update_properties_in_project(project_id=project['id'], title=title, description=description, json_interface=json_interface) emails = [ '*****@*****.**', '*****@*****.**' ] for email in emails: playground.append_to_roles(project_id=project['id'], user_email=email, role='ADMIN')