The Unstructured Ingest Python library does not work with the Unstructured API.For information about the Unstructured API, see the Unstructured API Overview.
Getting started
You can use the Unstructured Ingest Python library to process files locally, or you can use the Ingest Python library to send files in batches to Unstructured for processing. Local processing does not use an Unstructured API key or API URL. Using the Ingest Python library to send files in batches to Unstructured for processing is more robust, and usage is billed to you on a pay-as-you-go basis. Usage requires an Unstructured API key and API URL, as follows:-
If you do not already have an Unstructured account, sign up for free.
After you sign up, you are automatically signed in to your new Unstructured Starter account, at https://platform.unstructured.io.
To sign up for a Team or Enterprise account instead, contact Unstructured Sales, or learn more.
-
If you have an Unstructured Starter or Team account and are not already signed in, sign in to your account at https://platform.unstructured.io.
For an Enterprise account, see your Unstructured account administrator for instructions, or email Unstructured Support at support@unstructured.io.
-
Get your Unstructured API key:
a. After you sign in to your Unstructured Starter account, click API Keys on the sidebar.
b. Click Generate API Key.For a Team or Enterprise account, before you click API Keys, make sure you have selected the organizational workspace you want to create an API key for. Each API key works with one and only one organizational workspace. Learn more.
c. Follow the on-screen instructions to finish generating the key.
d. Click the Copy icon next to your new key to add the key to your system’s clipboard. If you lose this key, simply return and click the Copy icon again.
- The Unstructured API URL for Unstructured Ingest was provided to you when your Unstructured account was created. If you do not have this URL, email Unstructured Support at support@unstructured.io.
The default URL for Unstructured Ingest is the same as the default URL for the Unstructured Partition Endpoint:
https://api.unstructuredapp.io/general/v0/general
.
However, you should always use the URL that was provided to you when your Unstructured account was created.Installation
One approach to get started quickly with the Unstructured Ingest Python library is to install Python and then run the following command:To migrate from older, deprecated versions of the Ingest Python library that used
pip install unstructured
, see the migration guide.Usage
For example, to use the Unstructured Ingest Python library to ingest files from a local source (input) location and to deliver the processed data to an Azure Storage account destination (output) location:Migration guide
The Unstructured Ingest Python library introduced breaking changes in version 0.7.0 as follows:-
The library has moved the calling pattern (formerly commonly referred to as “v2”) up one level in the package. If you are using this calling pattern
in your existing code, beginning with version 0.7.0 you must remove
.v2
from your relatedfrom...import
statements. For example, if you previously had statments such as these:Beginning with version 0.7.0, you must change to these by removing.v2
:If you do not make these changes beginning with version 0.7.0, your existing code will no longer work. To run your existing code without making these changes, you must pin your installed library version to 0.6.4 or earlier. - The earlier calling pattern (commonly referred to as “v1”) has been deprecated and removed from the library and will no longer work beginning with version 0.7.0. If you are using this earlier “v1” calling pattern in your code, you must either manually migrate your code to the new calling pattern (formerly commonly referred to as “v2”), or pin your installed library version to 0.6.4 or earlier to keep using this earlier “v1” calling pattern. To learn how to use the new calling pattern (formerly commonly referred to as “v2”), see the code examples in the source connectors and destination connectors documentation.