Skip to content

Commit 06c8bad

Browse files
authored
Update README.rst
1 parent f396ec6 commit 06c8bad

File tree

1 file changed

+42
-22
lines changed

1 file changed

+42
-22
lines changed

README.rst

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
===================
1+
=====================
22
Scale AI | Python SDK
3-
===================
3+
=====================
44

5-
# Installation
5+
Installation
6+
____________
67

78
.. code-block:: bash
89
910
$ pip install --upgrade scaleapi
1011
1112
Note: We strongly suggest using `scaleapi` with Python version 2.7.9 or greater due to SSL issues with prior versions.
1213

13-
# Usage
14+
Usage
15+
_____
1416

1517
.. code-block:: python
1618
1719
import scaleapi
1820
client = scaleapi.ScaleClient('YOUR_API_KEY_HERE')
1921
20-
# Tasks
22+
Tasks
23+
_____
2124

2225
Most of these methods will return a `scaleapi.Task` object, which will contain information
2326
about the json response (task_id, status...).
@@ -28,7 +31,8 @@ Any parameter available in the documentation\_ can be passed as an argument opti
2831
2932
The following endpoints for tasks are available:
3033

31-
## Create Task
34+
Create Task
35+
^^^^^^^^^^^
3236

3337
This method can be used for any Scale supported task type using the following format:
3438
`client.create_{{Task Type}}_task(...)` and passing the applicable values into the function definition. The applicable fields and further information for each task type can be found in scales API docs `here`\_\_ for further information.
@@ -52,7 +56,8 @@ This method can be used for any Scale supported task type using the following fo
5256
}
5357
)
5458
55-
## Retrieve task
59+
Retrieve task
60+
^^^^^^^^^^^^^
5661

5762
Check `this`\_\_ for further information.
5863

@@ -66,7 +71,8 @@ Retrieve a task given its id.
6671
print(task.status) // Task status ('pending', 'completed', 'error', 'canceled')
6772
print(task.response) // If task is complete
6873
69-
## List Tasks
74+
List Tasks
75+
^^^^^^^^^^
7076

7177
Check `this`\_\_ for further information.
7278

@@ -95,7 +101,8 @@ Retrieve a list of tasks, with optional filter by stand and end date/type. Pagin
95101
break
96102
print(all_tasks)
97103
98-
## Cancel Task
104+
Cancel Task
105+
^^^^^^^^^^^
99106

100107
Check `this`\_\_ for further information.
101108

@@ -107,9 +114,11 @@ Cancel a task given its id if work has not stared on the task (task status is "q
107114
108115
task = client.cancel_task('asdfasdfasdfasdfasdfasdf')
109116
110-
# Batches
117+
Batches
118+
_______
111119

112-
## Create Batch
120+
Create Batch
121+
^^^^^^^^^^^^
113122

114123
Check `this`\_\_ for further information.
115124

@@ -123,7 +132,8 @@ Check `this`\_\_ for further information.
123132
name = 'batch_name_01_07_2021'
124133
)
125134
126-
## Finalize Batceh
135+
Finalize Batceh
136+
^^^^^^^^^^^^^^^
127137

128138
Check `this`\_\_ for further information.
129139

@@ -133,7 +143,8 @@ Check `this`\_\_ for further information.
133143
134144
client.create_batch(batch_name = 'batch_name_01_07_2021')
135145
136-
## Check Batch Status
146+
Check Batch Status
147+
^^^^^^^^^^^^^^^^^^
137148

138149
Check `this`\_\_ for further information.
139150

@@ -143,7 +154,8 @@ Check `this`\_\_ for further information.
143154
144155
client.batch_status(batch_name = 'batch_name_01_07_2021')
145156
146-
## Retrieve Batch
157+
Retrieve Batch
158+
^^^^^^^^^^^^^^
147159

148160
Check `this`\_\_ for further information.
149161

@@ -153,7 +165,8 @@ Check `this`\_\_ for further information.
153165
154166
client.get_batch( batch_name = "batch_name_01_07_2021" )
155167
156-
## List Batches
168+
List Batches
169+
^^^^^^^^^^^^
157170

158171
Check `this`\_\_ for further information.
159172

@@ -179,9 +192,11 @@ Retrieve a list of batches
179192
break
180193
print(all_batchs)
181194
182-
# Projects
195+
Projects
196+
________
183197

184-
## Create Project
198+
Create Project
199+
^^^^^^^^^^^^^^
185200

186201
Check `this`\_\_ for further information.
187202

@@ -195,7 +210,8 @@ Check `this`\_\_ for further information.
195210
params = {'instruction':'Please label the kittens'}
196211
)
197212
198-
## Retrieve Project
213+
Retrieve Project
214+
^^^^^^^^^^^^^^^^
199215

200216
Check `this`\_\_ for further information.
201217

@@ -205,7 +221,8 @@ Check `this`\_\_ for further information.
205221
206222
client.get_projet(project_name = 'test_project')
207223
208-
## List Projects
224+
List Projects
225+
^^^^^^^^^^^^^
209226

210227
This function does not take any arguments. It will return information for every project.
211228
Check `this`\_\_ for further information.
@@ -222,7 +239,8 @@ Retrieve a list of batches
222239
counter += 1
223240
print('Downloading project %s | %s | %s' % (counter, project['name'], project['type']))
224241
225-
## Update Project
242+
Update Project
243+
^^^^^^^^^^^^^^
226244

227245
Check `this`\_\_ for further information.
228246

@@ -239,7 +257,8 @@ Retrieve a list of batches
239257
240258
)
241259

242-
# Error handling
260+
Error handling
261+
______________
243262

244263
If something went wrong while making API calls, then exceptions will be raised automatically
245264
as a `scaleapi.ScaleException` or `scaleapi.ScaleInvalidRequest` runtime error. For example:
@@ -252,6 +271,7 @@ as a `scaleapi.ScaleException` or `scaleapi.ScaleInvalidRequest` runtime error.
252271
print(e.code) # 400
253272
print(e.message) # missing param X
254273
255-
# Troubleshooting
274+
Troubleshooting
275+
_______________
256276

257277
If you notice any problems, please email us at support@scale.com.

0 commit comments

Comments
 (0)