QuerySUTRA 0.6.0__py3-none-any.whl → 0.6.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuerySUTRA
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: AI-powered data analysis for structured and unstructured data. Query PDF, Word, CSV, Excel with natural language.
5
5
  Author: Aditya Batta
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
- querysutra-0.6.0.dist-info/licenses/LICENSE,sha256=F-4b93u0OVrVwGXgMwBRq6MlGyUT9zmre1oh5Gft5Ts,1066
2
- sutra/__init__.py,sha256=rRSfC1jjMvi8-LpP0P6dpMVx0xC_HnxsgisPr4WPkGM,200
1
+ querysutra-0.6.1.dist-info/licenses/LICENSE,sha256=F-4b93u0OVrVwGXgMwBRq6MlGyUT9zmre1oh5Gft5Ts,1066
2
+ sutra/__init__.py,sha256=A3aHSfTNRENEPi-tyMtOjGK_Ol4TwbmM1bQw5ycKlCM,200
3
3
  sutra/cache_manager.py,sha256=e0AAeUqoR-aiqzZ3fB-IDvpJ4JA6-YBFyRJxusEnIrA,3082
4
4
  sutra/clear_cache.py,sha256=rVIz29p7V11Uh6oHXeaWpFtYXXv-2OED91cHMAWWxtQ,187
5
5
  sutra/core.py,sha256=R_JbOlZTukegP92Dr-WLsdr632_otFN7o9qSvcxyBtw,10497
@@ -11,12 +11,12 @@ sutra/feedback_matcher.py,sha256=WXYpGtFJnOyYQOzy-z8uBiUWH5vyJJOMS1NwEYzNfic,286
11
11
  sutra/nlp_processor.py,sha256=cvMDvmtf3b2tTbFPItJgF_t541MQqP4SdEXECR1pa0Q,6719
12
12
  sutra/schema_embeddings.py,sha256=bVPzpJOdYTyUdG2k3ZdgYJLrX2opHBx68RIjJcMlueo,9732
13
13
  sutra/schema_generator.py,sha256=EYEOo7-ljSukTx9Mm2hXhgY-DFCgsaa7RpzDWqVx4K8,2348
14
- sutra/sutra.py,sha256=73A4HPZVf6jSl5T4ob1vuIbr7CXVnWHP70NfUYbCz-Y,27594
14
+ sutra/sutra.py,sha256=lwF7tV2eYz6cxC9fC42zHxJC0M8aZ3lNYd1HSpQKRAY,28004
15
15
  sutra/sutra_client.py,sha256=PYYDGqVbA9pB-Zcsm52i9KarwijCIGVZOThgONZP6Vs,14203
16
16
  sutra/sutra_core.py,sha256=diaWOXUHn1wrqCQrBhLKL612tMQioaqx-ILc3y9-CqM,11708
17
17
  sutra/sutra_simple.py,sha256=rnqzG7OAt4p64XtO0peMqHS1pG5tdA8U3EYTMVsq7BE,23201
18
18
  sutra/visualizer.py,sha256=YOKTmjQcY72smmx9KsZrQTdbAiE5GQDKofMFjpLIUfI,6996
19
- querysutra-0.6.0.dist-info/METADATA,sha256=e1PS_Cr8aByv3OYnE2kLxuLTUdsfjSAMNioP5DjYpBk,8252
20
- querysutra-0.6.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
21
- querysutra-0.6.0.dist-info/top_level.txt,sha256=tqRK7nxuOJvFTkUn-YahGogCSCkk1ZE90Wf3MgT9BDI,6
22
- querysutra-0.6.0.dist-info/RECORD,,
19
+ querysutra-0.6.1.dist-info/METADATA,sha256=a-aFX7ZQ38YOpJ5iB8ulAnlIAKKajFH6XkXyAdoXBgE,8252
20
+ querysutra-0.6.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
21
+ querysutra-0.6.1.dist-info/top_level.txt,sha256=tqRK7nxuOJvFTkUn-YahGogCSCkk1ZE90Wf3MgT9BDI,6
22
+ querysutra-0.6.1.dist-info/RECORD,,
sutra/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
- """QuerySUTRA v0.6.0 - AI-powered data analysis for structured and unstructured data"""
2
- __version__ = "0.6.0"
1
+ """QuerySUTRA v0.6.1 - AI-powered data analysis for structured and unstructured data"""
2
+ __version__ = "0.6.1"
3
3
 
4
4
  from .sutra import SUTRA, QueryResult
5
5
 
sutra/sutra.py CHANGED
@@ -1,5 +1,5 @@
1
- """QuerySUTRA v0.6.0 - AI-powered data analysis for structured and unstructured data"""
2
- __version__ = "0.6.0"
1
+ """QuerySUTRA v0.6.1 - AI-powered data analysis for structured and unstructured data"""
2
+ __version__ = "0.6.1"
3
3
  __author__ = "Aditya Batta"
4
4
  __all__ = ["SUTRA", "QueryResult"]
5
5
 
@@ -255,8 +255,17 @@ JSON:"""
255
255
  self._store(pd.DataFrame({'line': range(1, len(lines)+1), 'text': lines}), name)
256
256
 
257
257
  def _store(self, df: pd.DataFrame, name: str):
258
- """Store."""
258
+ """Store. Flattens any list/dict values to strings for SQLite compatibility."""
259
259
  df.columns = [str(c).strip().replace(" ", "_").replace("-", "_") for c in df.columns]
260
+
261
+ # Flatten list/dict values to strings — SQLite can't store Python objects
262
+ for col in df.columns:
263
+ df[col] = df[col].apply(
264
+ lambda x: ', '.join(str(i) for i in x) if isinstance(x, list)
265
+ else json.dumps(x) if isinstance(x, dict)
266
+ else x
267
+ )
268
+
260
269
  try:
261
270
  df.to_sql(name, self.conn, if_exists='replace', index=False, method='multi', chunksize=500)
262
271
  except: