This page was recently updated. What do you think about it? Let us know!.

Connect Google Cloud Storage to your preprocessing pipeline, and use the Unstructured Ingest CLI or the Unstructured Ingest Python library to batch process all your documents and store structured outputs locally on your filesystem.

You will need:

The Google Cloud Storage prerequisites:

  • A Google Cloud Storage bucket URL, beginning with gs://.
  • A Google Cloud service account key for Google Cloud Storage. The service account key must have at least the Storage Object Viewer role to ensure proper access permissions. Create a service account key. Assign a role.

Learn more.

The Google Cloud Storage connector dependencies:

CLI, Python
pip install "unstructured-ingest[gcs]"

You might also need to install additional dependencies, depending on your needs. Learn more.

The following environment variables:

  • GCS_SERVICE_ACCOUNT_KEY - The Google Cloud service account key for Google Cloud Storage, represented by --service-account-key (CLI) or service_account_key (Python).
  • GCS_REMOTE_URL - The Google Cloud Storage bucket URL, represented by --remote-url (CLI) or remote_url (Python).

These environment variables:

  • UNSTRUCTURED_API_KEY - Your Unstructured API key value.
  • UNSTRUCTURED_API_URL - Your Unstructured API URL.

Now call the Unstructured CLI or Python SDK. The destination connector can be any of the ones supported. This example uses the local destination connector: