You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Important**: Beginning with Python SDK 0.30.0, note the following:
16
-
17
-
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
18
-
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
19
-
- For the Free Unstructured API URL, do not use `https://api.unstructured.io/general/v0/general`, or else calls made by
20
-
the Python SDK will fail. Use `https://api.unstructured.io` instead.
21
-
- If your Python code previously used the `server_url` parameter inside of your `UnstructuredClient` constructor to specify your Unstructured API URL, you must move this `server_url` parameter into
22
-
your code's `partition` or `partition_async` function calls instead, or else calls made by the Python SDK will fail. To learn how, see the following code examples.
Copy file name to clipboardExpand all lines: api-reference/api-services/free-api.mdx
-11Lines changed: 0 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,6 @@ The Free Unstructured API requires authentication via an API key. Here's how you
19
19
5. Click **Submit**. You will receive a Free Unstructured API key at the **Email** you provided. Store your API key in a secure location. Do not share it with others.
20
20
6. For the Free Unstructured API, the API URL is `https://api.unstructured.io/general/v0/general`
21
21
22
-
<Warning>
23
-
**Important**: This article shows how to use Free Unstructured API with the Unstructured CLI and the
24
-
Unstructured Ingest Python library. While you can also use this API URL with the Unstructured Python SDK,
25
-
beginning with Python SDK 0.30.0, note the following:
26
-
27
-
- Do not use https://api.unstructured.io/general/v0/general, or else calls made by
28
-
the Python SDK will fail. Use https://api.unstructured.io` instead.
29
-
- If your Python code uses the `server_url` parameter inside of your `UnstructuredClient` constructor to specify this URL, you must move this `server_url` parameter into
30
-
your code's `partition` or `partition_async` function calls instead, or else calls made by the Python SDK will fail.
@@ -137,6 +119,10 @@ import SharedPagesBilling from '/snippets/general-shared-text/pages-billing.mdx'
137
119
138
120
These examples use your local machine. They send source (input) files from your local machine to the Unstructured Serverless API which delivers the processed data to a destination (output) location, also on your local machine. Data is processed on Unstructured-hosted compute resources.
To work with the Unstructured Serverless API by using the [Unstructured Ingest CLI](/ingestion/overview#unstructured-ingest-cli), you will need to:
@@ -147,12 +133,11 @@ To work with the Unstructured Serverless API by using the [Unstructured Ingest C
147
133
pip install unstructured-ingest
148
134
```
149
135
150
-
- Set the following environment variables:
136
+
- Set the following environment variable:
151
137
152
138
- Set `UNSTRUCTURED_API_KEY` to your API key.
153
-
- Set `UNSTRUCTURED_API_URL` to your API URL.
154
139
155
-
[Get your API key and API URL](#get-started).
140
+
[Get your API key](#get-started).
156
141
157
142
- Have some compatible files on your local machine to be processed. [See the list of supported file types](/api-reference/api-services/supported-file-types). If you do not have any files available, you can download some from the [example-docs](https://github.com/Unstructured-IO/unstructured-ingest/tree/main/example-docs) folder in the Unstructured repo on GitHub.
@@ -188,9 +172,8 @@ To work with the Unstructured Serverless API by using the [Unstructured Python l
188
172
- Set the following environment variables:
189
173
190
174
- Set `UNSTRUCTURED_API_KEY` to your API key.
191
-
- Set `UNSTRUCTURED_API_URL` to your API URL.
192
175
193
-
[Get your API key and API URL](#get-started).
176
+
[Get your API key](#get-started).
194
177
195
178
- Have some compatible files on your local machine to be processed. [See the list of supported file types](/api-reference/api-services/supported-file-types). If you do not have any files available, you can download some from the [example-docs](https://github.com/Unstructured-IO/unstructured-ingest/tree/main/example-docs) folder in the Unstructured repo on GitHub.
Copy file name to clipboardExpand all lines: api-reference/api-services/sdk-python.mdx
+9-72Lines changed: 9 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,6 @@ import SharedAPIKeyURL from '/snippets/general-shared-text/api-key-url.mdx';
18
18
19
19
<SharedAPIKeyURL />
20
20
21
-
<Warning>
22
-
**Important**: Beginning with Python SDK 0.30.0, note the following:
23
-
24
-
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
25
-
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
26
-
- For the Free Unstructured API URL, do not use `https://api.unstructured.io/general/v0/general`, or else calls made by
27
-
the Python SDK will fail. Use `https://api.unstructured.io` instead.
28
-
- If your Python code previously used the `server_url` parameter inside of your `UnstructuredClient` constructor to specify your Unstructured API URL, you must move this `server_url` parameter into
29
-
your code's `partition` or `partition_async` function calls instead, or else calls made by the Python SDK will fail. To learn how, see the following code examples.
@@ -246,8 +230,7 @@ import NoURLForServerlessAPI from '/snippets/general-shared-text/no-url-for-serv
246
230
)
247
231
)
248
232
res = client.general.partition(
249
-
request=req,
250
-
server_url=os.getenv("UNSTRUCTURED_API_URL")
233
+
request=req
251
234
)
252
235
```
253
236
@@ -263,8 +246,7 @@ import NoURLForServerlessAPI from '/snippets/general-shared-text/no-url-for-serv
263
246
import os
264
247
265
248
client = UnstructuredClient(
266
-
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
267
-
server_url=os.getenv("UNSTRUCTURED_API_URL"),
249
+
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
268
250
retry_config=RetryConfig(
269
251
strategy="backoff",
270
252
retry_connection_errors=True,
@@ -322,49 +304,7 @@ the names used in the SDKs are the same across all methods.
322
304
323
305
## Migration guide
324
306
325
-
There are breaking changes beginning with Python SDK version 0.26.0 and again in 0.30.0. If you encounter any errors when upgrading, please find the solution below.
326
-
327
-
**If you see the error: `404 Not Found`**
328
-
329
-
Before 0.30.0, you could specify the following Unstructured API URL for the `server_url` parameter:
330
-
331
-
- For the Unstructured Serverless API: `https://api.unstructuredapp.io/general/v0/general`
332
-
- For the Free Unstructured API: `https://api.unstructured.io/general/v0/general`
333
-
334
-
Beginning with 0.30.0, these Unstructured API URLs have changed as follows:
335
-
336
-
- For the Unstructured Serverless API: `https://api.unstructuredapp.io` (remove `/general/v0/general`)
337
-
- For the Free Unstructured API: `https://api.unstructured.io` (remove `/general/v0/general`)
338
-
339
-
Also, before 0.30.0, the `server_url` parameter was part of the `UnstructuredClient` constructor. Beginning with 0.30.0, the `server_url`
340
-
parameter has been moved into the `partition` and `partition_async` functions.
341
-
342
-
```python
343
-
# Instead of:
344
-
client = unstructured_client.UnstructuredClient(
345
-
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
346
-
server_url=os.getenv("UNSTRUCTURED_API_URL")
347
-
)
348
-
349
-
# Switch to:
350
-
client = unstructured_client.UnstructuredClient(
351
-
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
352
-
)
353
-
354
-
# And...
355
-
356
-
# For partition:
357
-
res = client.general.partition(
358
-
request=req,
359
-
server_url=os.getenv("UNSTRUCTURED_API_URL")
360
-
)
361
-
362
-
# For partition_async:
363
-
res =await client.general.partition_async(
364
-
request=req,
365
-
server_url=os.getenv("UNSTRUCTURED_API_URL")
366
-
)
367
-
```
307
+
There are breaking changes beginning with Python SDK version 0.26.0. If you encounter any errors when upgrading, please find the solution below.
368
308
369
309
**If you see the error: `AttributeError: 'PartitionParameters' object has no attribute 'partition_parameters'`**
0 commit comments