Skip to content

Commit a5c111d

Browse files
add studio api documentation
1 parent d23ffdf commit a5c111d

File tree

1 file changed

+179
-1
lines changed

1 file changed

+179
-1
lines changed

README.rst

Lines changed: 179 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,49 @@ The attribute can be passed to the task payloads, in the ``attachment`` paramete
525525
...
526526
...
527527
)
528+
529+
Manage Teammates
530+
________________
531+
532+
Manage the members of your Scale team via API. Check out `Scale Team API Documentation`__ for more information.
533+
534+
__ https://docs.scale.com/reference/teams-overview
535+
536+
List Teammates
537+
^^^^^^^^^^^^^^
538+
539+
Lists all teammates in your Scale team.
540+
Returns all teammates in a List of Teammate objects.
541+
542+
.. code-block:: python
543+
544+
teammates = client.list_teammates()
545+
546+
Invite Teammate
547+
^^^^^^^^^^^^^^^
548+
549+
Invites a list of email strings to your team with the provided role.
550+
The available teammate roles are: 'labeler', 'member', or 'manager'.
551+
Returns all teammates in a List of Teammate objects.
552+
553+
.. code-block:: python
554+
555+
from scaleapi import TeammateRole
556+
557+
teammates = client.invite_teammates(['email1@example.com', 'email2@example.com'], TeammateRole.Member)
558+
559+
Update Teammate Role
560+
^^^^^^^^^^^^^^^
561+
562+
Updates a list of emails of your Scale team members with the new role.
563+
The available teammate roles are: 'labeler', 'member', or 'manager'.
564+
Returns all teammates in a List of Teammate objects.
565+
566+
.. code-block python
567+
568+
from scaleapi import TeammateRole
569+
570+
teammates = client.update_teammates_role(['email1@example.com', 'email2@example.com'], TeammateRole.Manager)
528571
529572
Example Scripts
530573
_______________
@@ -612,6 +655,139 @@ Create a training task.
612655
613656
client.create_training_task(TaskType, ...task parameters...)
614657
658+
Studio Assignments (For Scale Studio only)
659+
__________________________________________
660+
661+
Manage project assignments for your labelers.
662+
663+
List All Assignments
664+
^^^^^^^^^^^^^^^^^^^^
665+
666+
Lists all your Scale team members and the projects they are assigned to.
667+
Returns a dictionary of all teammate assignemnts with keys as 'emails' of each teammate, and values as a list of project names the teammate is assigned to.
668+
669+
.. code-block:: python
670+
671+
assignments = client.list_studio_assignments()
672+
my_assignment = assignments.get('my-email@example.com')
673+
674+
Add Studio Assignment
675+
^^^^^^^^^^^^^^^^^^^^^
676+
677+
Assigns provided projects to specified teammate emails.
678+
679+
Accepts a list of emails and a list of projects.
680+
681+
Returns a dictionary of all teammate assignemnts with keys as 'emails' of each teammate, and values as a list of project names the teammate is assigned to.
682+
683+
.. code-block:: python
684+
685+
assignments = client.add_studio_assignments(['email1@example.com', 'email2@example.com'], ['project 1', 'project 2'])
686+
687+
688+
Remove Studio Assignment
689+
^^^^^^^^^^^^^^^^^^^^^^^^
690+
691+
Removes provided projects from specified teammate emails.
692+
693+
Accepts a list of emails and a list of projects.
694+
695+
Returns a dictionary of all teammate assignments with keys as 'emails' of each teammate, and values as a list of project names the teammate is assigned to.
696+
697+
.. code-block:: python
698+
699+
assignments = client.remove_studio_assignments(['email1@example.com', 'email2@example.com'], ['project 1', 'project 2'])
700+
701+
Studio Project Groups (For Scale Studio Only)
702+
______________________
703+
704+
Manage groups of labelers in our project by using Studio Project Groups.
705+
706+
List Studio Project Groups
707+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
708+
709+
Returns all labeler groups for the specified project.
710+
711+
.. code-block:: python
712+
713+
list_project_group = client.list_project_groups('project_name')
714+
715+
Add Studio Project Group
716+
^^^^^^^^^^^^^^^^^^^^^^^^
717+
718+
Creates a project group with the provided group_name for the specified project and adds the provided teammate emails to the new project group. The team members must be assigned to the specified project in order to be added to the new group.
719+
720+
Returns the created StudioProjectGroup object.
721+
722+
.. code-block:: python
723+
724+
added_project_group = client.create_project_group(
725+
'project_name', ['email1@example.com'], 'project_group_name'
726+
)
727+
728+
Update Studio Project Group
729+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
730+
731+
Assign or remove teammates from a project group.
732+
733+
Returns the updated StudioProjectGroup object.
734+
735+
.. code-block:: python
736+
737+
updated_project_group = client.update_project_group(
738+
'project_name', 'project_group_name', ['emails_to_add'], ['emails_to_remove']
739+
)
740+
741+
Studio Batches (For Scale Studio Only)
742+
________________
743+
744+
Get information about your pending Studio batches.
745+
746+
List Studio Batches
747+
^^^^^^^^^^^^^^^^^^^
748+
749+
Returns a list of StudioBatch objects for all pending Studio batches.
750+
751+
.. code-block:: python
752+
753+
studio_batches = client.list_studio_batches()
754+
755+
Assign Studio Batches
756+
^^^^^^^^^^^^^^^^^^^^^^
757+
758+
Sets labeler group assignment for the specified batch.
759+
760+
Returns a StudioBatch object for the specified batch.
761+
762+
.. code-block:: python
763+
764+
assigned_studio_batch = client.assign_studio_batches('batch_name', ['project_group_name'])
765+
766+
Set Studio Batches Priority
767+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
768+
769+
Sets the order to prioritize your pending Studio batches. You must include all pending studio batches in the List.
770+
771+
Returns a List of StudioBatch objects in the new order.
772+
773+
.. code-block:: python
774+
775+
studio_batch_priority = client.set_studio_batches_priorities(
776+
['pending_batch_1', 'pending_batch_2', 'pending_batch_3']
777+
)
778+
779+
Reset Studio Batches Priority
780+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
781+
782+
Resets the order of your Studio batches to the default order, which prioritizes older batches first.
783+
784+
Returns a List of StudioBatch objects in the new order.
785+
786+
.. code-block:: python
787+
788+
reset_studio_batch_prioprity = client.reset_studio_batches_priorities()
789+
790+
615791
Error handling
616792
______________
617793

@@ -642,7 +818,9 @@ For example:
642818
print(err.code) # 400
643819
print(err.message) # Parameter is invalid, reason: "attachments" is required
644820
821+
822+
645823
Troubleshooting
646824
_______________
647825

648-
If you notice any problems, please email us at support@scale.com.
826+
If you notice any problems, please contact our support via Intercom by logging into your dashboard, or, if you are Enterprise, by contacting your Engagement Manager.

0 commit comments

Comments
 (0)