unstructured-ingest 0.5.16__py3-none-any.whl → 0.5.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of unstructured-ingest might be problematic. Click here for more details.

@@ -1 +1 @@
1
- __version__ = "0.5.16" # pragma: no cover
1
+ __version__ = "0.5.18" # pragma: no cover
@@ -192,6 +192,16 @@ def get_data(path: Union[Path, str]) -> list[dict]:
192
192
  logger.warning(f"failed to read {path} as parquet: {e}")
193
193
 
194
194
 
195
+ def get_json_data(path: Path) -> list[dict]:
196
+ with path.open() as f:
197
+ if path.suffix == ".json":
198
+ return json.load(f)
199
+ elif path.suffix == ".ndjson":
200
+ return ndjson.load(f)
201
+ else:
202
+ raise ValueError(f"Unsupported file type: {path}")
203
+
204
+
195
205
  def get_data_df(path: Path) -> pd.DataFrame:
196
206
  with path.open() as f:
197
207
  if path.suffix == ".json":
@@ -112,7 +112,6 @@ def get_astra_collection(
112
112
  collection_name: str,
113
113
  keyspace: str,
114
114
  ) -> "AstraDBCollection":
115
-
116
115
  astra_db = get_astra_db(connection_config=connection_config, keyspace=keyspace)
117
116
 
118
117
  # astradb will return a collection object in all cases (even if it doesn't exist)
@@ -315,6 +314,7 @@ class AstraDBUploadStager(UploadStager):
315
314
  text_as_html, MAX_CONTENT_PARAM_BYTE_SIZE
316
315
  )
317
316
  metadata["original_elements"] = format_and_truncate_orig_elements(element_dict)
317
+ metadata.pop("orig_elements", None)
318
318
 
319
319
  def conform_dict(self, element_dict: dict, file_data: FileData) -> dict:
320
320
  self.truncate_dict_elements(element_dict)
@@ -1,4 +1,3 @@
1
- import json
2
1
  import os
3
2
  import traceback
4
3
  from dataclasses import dataclass, field
@@ -11,7 +10,7 @@ import pandas as pd
11
10
  from pydantic import Field, Secret
12
11
 
13
12
  from unstructured_ingest.error import DestinationConnectionError
14
- from unstructured_ingest.utils.data_prep import get_data_df
13
+ from unstructured_ingest.utils.data_prep import get_data_df, get_json_data
15
14
  from unstructured_ingest.utils.dep_check import requires_dependencies
16
15
  from unstructured_ingest.utils.table import convert_to_pandas_dataframe
17
16
  from unstructured_ingest.v2.interfaces import (
@@ -86,9 +85,7 @@ class DeltaTableUploadStager(UploadStager):
86
85
  output_filename: str,
87
86
  **kwargs: Any,
88
87
  ) -> Path:
89
- with open(elements_filepath) as elements_file:
90
- elements_contents = json.load(elements_file)
91
-
88
+ elements_contents = get_json_data(elements_filepath)
92
89
  output_path = Path(output_dir) / Path(f"{output_filename}.parquet")
93
90
 
94
91
  df = convert_to_pandas_dataframe(elements_dict=elements_contents)
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import asyncio
4
- import json
5
4
  import uuid
6
5
  from collections import defaultdict
7
6
  from contextlib import asynccontextmanager
@@ -14,7 +13,7 @@ from pydantic import BaseModel, ConfigDict, Field, Secret, field_validator
14
13
 
15
14
  from unstructured_ingest.error import DestinationConnectionError
16
15
  from unstructured_ingest.logger import logger
17
- from unstructured_ingest.utils.data_prep import batch_generator
16
+ from unstructured_ingest.utils.data_prep import batch_generator, get_json_data
18
17
  from unstructured_ingest.utils.dep_check import requires_dependencies
19
18
  from unstructured_ingest.v2.interfaces import (
20
19
  AccessConfig,
@@ -97,8 +96,7 @@ class Neo4jUploadStager(UploadStager):
97
96
  output_filename: str,
98
97
  **kwargs: Any,
99
98
  ) -> Path:
100
- with elements_filepath.open() as file:
101
- elements = json.load(file)
99
+ elements = get_json_data(elements_filepath)
102
100
 
103
101
  nx_graph = self._create_lexical_graph(
104
102
  elements, self._create_document_node(file_data=file_data)
@@ -294,8 +292,7 @@ class Neo4jUploader(Uploader):
294
292
  return True
295
293
 
296
294
  async def run_async(self, path: Path, file_data: FileData, **kwargs) -> None: # type: ignore
297
- with path.open() as file:
298
- staged_data = json.load(file)
295
+ staged_data = get_json_data(path)
299
296
 
300
297
  graph_data = _GraphData.model_validate(staged_data)
301
298
  async with self.connection_config.get_client() as client:
@@ -35,6 +35,10 @@ from unstructured_ingest.v2.processes.connector_registry import (
35
35
  DestinationRegistryEntry,
36
36
  SourceRegistryEntry,
37
37
  )
38
+ from unstructured_ingest.v2.processes.utils.blob_storage import (
39
+ BlobStoreUploadStager,
40
+ BlobStoreUploadStagerConfig,
41
+ )
38
42
 
39
43
  if TYPE_CHECKING:
40
44
  from office365.graph_client import GraphClient
@@ -428,4 +432,6 @@ onedrive_destination_entry = DestinationRegistryEntry(
428
432
  connection_config=OnedriveConnectionConfig,
429
433
  uploader=OnedriveUploader,
430
434
  uploader_config=OnedriveUploaderConfig,
435
+ upload_stager_config=BlobStoreUploadStagerConfig,
436
+ upload_stager=BlobStoreUploadStager,
431
437
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: unstructured-ingest
3
- Version: 0.5.16
3
+ Version: 0.5.18
4
4
  Summary: A library that prepares raw documents for downstream ML tasks.
5
5
  Home-page: https://github.com/Unstructured-IO/unstructured-ingest
6
6
  Author: Unstructured Technologies
@@ -22,13 +22,13 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
22
  Requires-Python: >=3.9.0,<3.14
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE.md
25
- Requires-Dist: pandas
25
+ Requires-Dist: python-dateutil
26
26
  Requires-Dist: opentelemetry-sdk
27
- Requires-Dist: tqdm
27
+ Requires-Dist: pandas
28
28
  Requires-Dist: dataclasses_json
29
- Requires-Dist: pydantic>=2.7
30
- Requires-Dist: python-dateutil
29
+ Requires-Dist: tqdm
31
30
  Requires-Dist: click
31
+ Requires-Dist: pydantic>=2.7
32
32
  Provides-Extra: remote
33
33
  Requires-Dist: unstructured-client>=0.30.0; extra == "remote"
34
34
  Provides-Extra: csv
@@ -71,8 +71,8 @@ Requires-Dist: fsspec; extra == "azure"
71
71
  Provides-Extra: azure-ai-search
72
72
  Requires-Dist: azure-search-documents; extra == "azure-ai-search"
73
73
  Provides-Extra: biomed
74
- Requires-Dist: requests; extra == "biomed"
75
74
  Requires-Dist: bs4; extra == "biomed"
75
+ Requires-Dist: requests; extra == "biomed"
76
76
  Provides-Extra: box
77
77
  Requires-Dist: boxfs; extra == "box"
78
78
  Requires-Dist: fsspec; extra == "box"
@@ -98,12 +98,12 @@ Requires-Dist: duckdb; extra == "duckdb"
98
98
  Provides-Extra: elasticsearch
99
99
  Requires-Dist: elasticsearch[async]; extra == "elasticsearch"
100
100
  Provides-Extra: gcs
101
- Requires-Dist: fsspec; extra == "gcs"
102
101
  Requires-Dist: bs4; extra == "gcs"
102
+ Requires-Dist: fsspec; extra == "gcs"
103
103
  Requires-Dist: gcsfs; extra == "gcs"
104
104
  Provides-Extra: github
105
- Requires-Dist: requests; extra == "github"
106
105
  Requires-Dist: pygithub>1.58.0; extra == "github"
106
+ Requires-Dist: requests; extra == "github"
107
107
  Provides-Extra: gitlab
108
108
  Requires-Dist: python-gitlab; extra == "gitlab"
109
109
  Provides-Extra: google-drive
@@ -124,23 +124,23 @@ Requires-Dist: pymilvus; extra == "milvus"
124
124
  Provides-Extra: mongodb
125
125
  Requires-Dist: pymongo; extra == "mongodb"
126
126
  Provides-Extra: neo4j
127
+ Requires-Dist: networkx; extra == "neo4j"
127
128
  Requires-Dist: neo4j-rust-ext; extra == "neo4j"
128
129
  Requires-Dist: cymple; extra == "neo4j"
129
- Requires-Dist: networkx; extra == "neo4j"
130
130
  Provides-Extra: notion
131
131
  Requires-Dist: httpx; extra == "notion"
132
- Requires-Dist: htmlBuilder; extra == "notion"
133
- Requires-Dist: notion-client; extra == "notion"
134
132
  Requires-Dist: backoff; extra == "notion"
133
+ Requires-Dist: notion-client; extra == "notion"
134
+ Requires-Dist: htmlBuilder; extra == "notion"
135
135
  Provides-Extra: onedrive
136
- Requires-Dist: msal; extra == "onedrive"
137
- Requires-Dist: Office365-REST-Python-Client; extra == "onedrive"
138
136
  Requires-Dist: bs4; extra == "onedrive"
137
+ Requires-Dist: Office365-REST-Python-Client; extra == "onedrive"
138
+ Requires-Dist: msal; extra == "onedrive"
139
139
  Provides-Extra: opensearch
140
140
  Requires-Dist: opensearch-py; extra == "opensearch"
141
141
  Provides-Extra: outlook
142
- Requires-Dist: msal; extra == "outlook"
143
142
  Requires-Dist: Office365-REST-Python-Client; extra == "outlook"
143
+ Requires-Dist: msal; extra == "outlook"
144
144
  Provides-Extra: pinecone
145
145
  Requires-Dist: pinecone-client>=3.7.1; extra == "pinecone"
146
146
  Provides-Extra: postgres
@@ -152,16 +152,16 @@ Requires-Dist: praw; extra == "reddit"
152
152
  Provides-Extra: redis
153
153
  Requires-Dist: redis; extra == "redis"
154
154
  Provides-Extra: s3
155
- Requires-Dist: s3fs; extra == "s3"
156
155
  Requires-Dist: fsspec; extra == "s3"
156
+ Requires-Dist: s3fs; extra == "s3"
157
157
  Provides-Extra: sharepoint
158
- Requires-Dist: msal; extra == "sharepoint"
159
158
  Requires-Dist: Office365-REST-Python-Client; extra == "sharepoint"
159
+ Requires-Dist: msal; extra == "sharepoint"
160
160
  Provides-Extra: salesforce
161
161
  Requires-Dist: simple-salesforce; extra == "salesforce"
162
162
  Provides-Extra: sftp
163
- Requires-Dist: fsspec; extra == "sftp"
164
163
  Requires-Dist: paramiko; extra == "sftp"
164
+ Requires-Dist: fsspec; extra == "sftp"
165
165
  Provides-Extra: slack
166
166
  Requires-Dist: slack_sdk[optional]; extra == "slack"
167
167
  Provides-Extra: snowflake
@@ -179,21 +179,21 @@ Provides-Extra: singlestore
179
179
  Requires-Dist: singlestoredb; extra == "singlestore"
180
180
  Provides-Extra: vectara
181
181
  Requires-Dist: aiofiles; extra == "vectara"
182
- Requires-Dist: requests; extra == "vectara"
183
182
  Requires-Dist: httpx; extra == "vectara"
183
+ Requires-Dist: requests; extra == "vectara"
184
184
  Provides-Extra: vastdb
185
- Requires-Dist: ibis; extra == "vastdb"
186
185
  Requires-Dist: vastdb; extra == "vastdb"
187
186
  Requires-Dist: pyarrow; extra == "vastdb"
187
+ Requires-Dist: ibis; extra == "vastdb"
188
188
  Provides-Extra: zendesk
189
+ Requires-Dist: aiofiles; extra == "zendesk"
189
190
  Requires-Dist: httpx; extra == "zendesk"
190
191
  Requires-Dist: bs4; extra == "zendesk"
191
- Requires-Dist: aiofiles; extra == "zendesk"
192
192
  Provides-Extra: embed-huggingface
193
193
  Requires-Dist: sentence-transformers; extra == "embed-huggingface"
194
194
  Provides-Extra: embed-octoai
195
- Requires-Dist: tiktoken; extra == "embed-octoai"
196
195
  Requires-Dist: openai; extra == "embed-octoai"
196
+ Requires-Dist: tiktoken; extra == "embed-octoai"
197
197
  Provides-Extra: embed-vertexai
198
198
  Requires-Dist: vertexai; extra == "embed-vertexai"
199
199
  Provides-Extra: embed-voyageai
@@ -201,8 +201,8 @@ Requires-Dist: voyageai; extra == "embed-voyageai"
201
201
  Provides-Extra: embed-mixedbreadai
202
202
  Requires-Dist: mixedbread-ai; extra == "embed-mixedbreadai"
203
203
  Provides-Extra: openai
204
- Requires-Dist: tiktoken; extra == "openai"
205
204
  Requires-Dist: openai; extra == "openai"
205
+ Requires-Dist: tiktoken; extra == "openai"
206
206
  Provides-Extra: bedrock
207
207
  Requires-Dist: aioboto3; extra == "bedrock"
208
208
  Requires-Dist: boto3; extra == "bedrock"
@@ -111,7 +111,7 @@ test/unit/v2/partitioners/test_partitioner.py,sha256=iIYg7IpftV3LusoO4H8tr1IHY1U
111
111
  test/unit/v2/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
112
  test/unit/v2/utils/data_generator.py,sha256=UoYVNjG4S4wlaA9gceQ82HIpF9_6I1UTHD1_GrQBHp0,973
113
113
  unstructured_ingest/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
114
- unstructured_ingest/__version__.py,sha256=EgX3pL6NG5u1RONYNW1ysr-stCliU2U7MUb-vn-absY,43
114
+ unstructured_ingest/__version__.py,sha256=QYn6GUOSyCz_KH2wi4yg_FlUU4SE844Xhf0hR6-jv8s,43
115
115
  unstructured_ingest/error.py,sha256=qDncnJgbf5ils956RcO2CGlAKYDT5OaEM9Clv1JVTNc,1448
116
116
  unstructured_ingest/interfaces.py,sha256=7DOnDpGvUNlCoFR7UPRGmOarqH5sFtuUOO5vf8X3oTM,31489
117
117
  unstructured_ingest/logger.py,sha256=S5nSqGcABoQyeicgRnBQFjDScCaTvFVivOCvbo-laL0,4479
@@ -370,7 +370,7 @@ unstructured_ingest/runner/writers/fsspec/s3.py,sha256=kHJq2O3864QBd_tL2SKb0mdyw
370
370
  unstructured_ingest/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
371
371
  unstructured_ingest/utils/chunking.py,sha256=9b3sXMA6L8RW5xAkKQbwdtVudGLAcj_sgT6Grh5tyYM,1870
372
372
  unstructured_ingest/utils/compression.py,sha256=NNiY-2S2Gf3at7zC1PYxMijaEza9vVSzRn5mdFf6mHo,4434
373
- unstructured_ingest/utils/data_prep.py,sha256=AKtsdu9stYA63CV1C5B_fFWigqy-giVv-euumitos-A,7266
373
+ unstructured_ingest/utils/data_prep.py,sha256=MfID_7SPZHeZztlNTSXIzilaWvv1mdfCcLlhqpGLYNg,7557
374
374
  unstructured_ingest/utils/dep_check.py,sha256=SXXcUna2H0RtxA6j1S2NGkvQa9JP2DujWhmyBa7776Y,2400
375
375
  unstructured_ingest/utils/google_filetype.py,sha256=YVspEkiiBrRUSGVeVbsavvLvTmizdy2e6TsjigXTSRU,468
376
376
  unstructured_ingest/utils/html.py,sha256=DGRDMqGbwH8RiF94Qh6NiqVkbbjZfe1h26dIehC-X7M,6340
@@ -428,12 +428,12 @@ unstructured_ingest/v2/processes/partitioner.py,sha256=HxopDSbovLh_1epeGeVtuWEX7
428
428
  unstructured_ingest/v2/processes/uncompress.py,sha256=Z_XfsITGdyaRwhtNUc7bMj5Y2jLuBge8KoK4nxhqKag,2425
429
429
  unstructured_ingest/v2/processes/connectors/__init__.py,sha256=ebLvZes84qRx4eS20SkvlVH6WIIM76hifyUgkUJ-dfg,6588
430
430
  unstructured_ingest/v2/processes/connectors/airtable.py,sha256=eeZJe-bBNxt5Sa-XEFCdcGeJCguJU5WN2Mv9kLp5dVQ,8917
431
- unstructured_ingest/v2/processes/connectors/astradb.py,sha256=E6fB4anCd_gtSzVUsZ5pDrfdxs5AWERQM_NEfeenfEs,18202
431
+ unstructured_ingest/v2/processes/connectors/astradb.py,sha256=5xc5pWFicE_-2BV38oK-nnzAMI2EzF-q8XAqQ3qPUR8,18249
432
432
  unstructured_ingest/v2/processes/connectors/azure_ai_search.py,sha256=ngPDpU0oZ6m5sxIlB6u5ebQpqCS_SJ-_amCC1KQ03EQ,11529
433
433
  unstructured_ingest/v2/processes/connectors/chroma.py,sha256=VHCnM56qNXuHzovJihrNfJnZbWLJShOe8j12PJFrbL0,7219
434
434
  unstructured_ingest/v2/processes/connectors/confluence.py,sha256=gSs4-AxL0gfeWdJfP7JfCrQSQNLoJRkvHquKK9RJvpQ,12043
435
435
  unstructured_ingest/v2/processes/connectors/couchbase.py,sha256=i7vuNKsUkN93JRVmg4--MO0ZgbjvhIqt46oYqk9zFSQ,12250
436
- unstructured_ingest/v2/processes/connectors/delta_table.py,sha256=xvLWTSFEC3gyGTwEISXxWmUoAfCgzdgZkETMMBOPHuI,7153
436
+ unstructured_ingest/v2/processes/connectors/delta_table.py,sha256=bfEGiepJLOS9TxK-bMkjTTjHLHUc0q7qUzIYdwkLDMs,7104
437
437
  unstructured_ingest/v2/processes/connectors/discord.py,sha256=-e4-cBK4TnHkknK1qIb86AIVMy81lBgC288_iLpTzM8,5246
438
438
  unstructured_ingest/v2/processes/connectors/gitlab.py,sha256=ufE65Z8q_tC4oppGg5BsGXwSaL7RbEXcaagJQYsylNo,9984
439
439
  unstructured_ingest/v2/processes/connectors/google_drive.py,sha256=QzcHNelUbnubsDtanFIgDCRzmYTuP-GjJ_g9y8fButE,19623
@@ -442,8 +442,8 @@ unstructured_ingest/v2/processes/connectors/kdbai.py,sha256=VRDAiou_7oWOIAgQTdOG
442
442
  unstructured_ingest/v2/processes/connectors/local.py,sha256=FWPRjjUsnQjyZMChuZGuMU04AB5X0sFEOcAXhx1r9sk,7381
443
443
  unstructured_ingest/v2/processes/connectors/milvus.py,sha256=wmcu9NVy3gYlQGT25inN5w_QrhFoL8-hRq0pJFSNw8g,8866
444
444
  unstructured_ingest/v2/processes/connectors/mongodb.py,sha256=cL0QUQZF_s2brh3nNNeAywXVpaIiND4b5JTAFlYjLjw,14273
445
- unstructured_ingest/v2/processes/connectors/neo4j.py,sha256=vxf6Xuh-OMS09Y-mIF0PIwrFauqRtoI7vjeLBXsFwTk,18744
446
- unstructured_ingest/v2/processes/connectors/onedrive.py,sha256=EM9fq67RsiudZvZbi6nDXkS-i6W0xLvbkNvD0G-Ni5E,17779
445
+ unstructured_ingest/v2/processes/connectors/neo4j.py,sha256=I-eDLAlThHKKFQfkZpQL8CLFBDy5krWgTQANLgMTwTk,18679
446
+ unstructured_ingest/v2/processes/connectors/onedrive.py,sha256=5rg7t40gKxDHNcuJrJHmVzJ9uM7Ct4RBOvFsfwdGc5c,18002
447
447
  unstructured_ingest/v2/processes/connectors/outlook.py,sha256=KgNGM8hImRhy6_SpswRP2VwRD4VOrqqJoySgxf2oduI,9290
448
448
  unstructured_ingest/v2/processes/connectors/pinecone.py,sha256=O9lC4mZ9V_exg9apiCJSWHsgkuYDSEOlI6CaUS5ZB7c,13961
449
449
  unstructured_ingest/v2/processes/connectors/redisdb.py,sha256=p0AY4ukBNpwAemV4bWzpScvVbLTVlI3DzsCNUKiBI5M,6757
@@ -577,9 +577,9 @@ unstructured_ingest/v2/processes/connectors/zendesk/client.py,sha256=DDAYQB7catK
577
577
  unstructured_ingest/v2/processes/connectors/zendesk/zendesk.py,sha256=R8SXYkRhVUoWEHdGCt2CzcTxxuFundw_0GlGZ34YmbM,8987
578
578
  unstructured_ingest/v2/processes/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
579
579
  unstructured_ingest/v2/processes/utils/blob_storage.py,sha256=EWvK4HRYubr9i1UyMhv5cU9u0UzVkCDC_BIm4Uxab7Y,964
580
- unstructured_ingest-0.5.16.dist-info/LICENSE.md,sha256=SxkKP_62uIAKb9mb1eH7FH4Kn2aYT09fgjKpJt5PyTk,11360
581
- unstructured_ingest-0.5.16.dist-info/METADATA,sha256=Sm1qizGZbPHlXmzpcPhDuIsO-uWO-mrpfQZhovwhTQI,8465
582
- unstructured_ingest-0.5.16.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
583
- unstructured_ingest-0.5.16.dist-info/entry_points.txt,sha256=gUAAFnjFPnBgThJSEbw0N5ZjxtaKlT1s9e05_arQrNw,70
584
- unstructured_ingest-0.5.16.dist-info/top_level.txt,sha256=DMuDMHZRMdeay8v8Kdi855muIv92F0OkutvBCaBEW6M,25
585
- unstructured_ingest-0.5.16.dist-info/RECORD,,
580
+ unstructured_ingest-0.5.18.dist-info/LICENSE.md,sha256=SxkKP_62uIAKb9mb1eH7FH4Kn2aYT09fgjKpJt5PyTk,11360
581
+ unstructured_ingest-0.5.18.dist-info/METADATA,sha256=K47-NP1RfNwqRnvbZ8vO75ab5J5RSmb5nocwSXNwqko,8465
582
+ unstructured_ingest-0.5.18.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
583
+ unstructured_ingest-0.5.18.dist-info/entry_points.txt,sha256=gUAAFnjFPnBgThJSEbw0N5ZjxtaKlT1s9e05_arQrNw,70
584
+ unstructured_ingest-0.5.18.dist-info/top_level.txt,sha256=DMuDMHZRMdeay8v8Kdi855muIv92F0OkutvBCaBEW6M,25
585
+ unstructured_ingest-0.5.18.dist-info/RECORD,,