discovery-engine-api 0.2.89__tar.gz → 0.2.90__tar.gz

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: discovery-engine-api
3
- Version: 0.2.89
3
+ Version: 0.2.90
4
4
  Summary: Python SDK for Disco API
5
5
  Project-URL: Homepage, https://www.leap-labs.com
6
6
  Project-URL: Documentation, https://disco.leap-labs.com/llms-full.txt
@@ -78,7 +78,7 @@ Get your API key from the [Developers page](https://disco.leap-labs.com/develope
78
78
  await engine.discover(
79
79
  file: str | Path | pd.DataFrame, # Dataset to analyze
80
80
  target_column: str, # Column to predict/analyze
81
- depth_iterations: int = 2, # 1=fast, higher=deeper search
81
+ analysis_depth: int = 2, # 1=fast, higher=deeper search
82
82
  visibility: str = "public", # "public" (free) or "private" (credits)
83
83
  title: str | None = None, # Dataset title
84
84
  description: str | None = None, # Dataset description
@@ -214,14 +214,14 @@ print(f"Explore: {result.report_url}")
214
214
 
215
215
  - **Public runs**: Free. Results published to public gallery.
216
216
  - **Private runs**: 1 credit per MB per depth iteration. $1.00 per credit.
217
- - **Formula**: `credits = max(1, ceil(file_size_mb * depth_iterations))`
217
+ - **Formula**: `credits = max(1, ceil(file_size_mb * analysis_depth))`
218
218
 
219
219
  ```python
220
220
  # Estimate cost before running
221
221
  estimate = await engine.estimate(
222
222
  file_size_mb=10.5,
223
223
  num_columns=25,
224
- depth_iterations=2,
224
+ analysis_depth=2,
225
225
  visibility="private",
226
226
  )
227
227
  # estimate["cost"]["credits"] -> 21
@@ -41,7 +41,7 @@ Get your API key from the [Developers page](https://disco.leap-labs.com/develope
41
41
  await engine.discover(
42
42
  file: str | Path | pd.DataFrame, # Dataset to analyze
43
43
  target_column: str, # Column to predict/analyze
44
- depth_iterations: int = 2, # 1=fast, higher=deeper search
44
+ analysis_depth: int = 2, # 1=fast, higher=deeper search
45
45
  visibility: str = "public", # "public" (free) or "private" (credits)
46
46
  title: str | None = None, # Dataset title
47
47
  description: str | None = None, # Dataset description
@@ -177,14 +177,14 @@ print(f"Explore: {result.report_url}")
177
177
 
178
178
  - **Public runs**: Free. Results published to public gallery.
179
179
  - **Private runs**: 1 credit per MB per depth iteration. $1.00 per credit.
180
- - **Formula**: `credits = max(1, ceil(file_size_mb * depth_iterations))`
180
+ - **Formula**: `credits = max(1, ceil(file_size_mb * analysis_depth))`
181
181
 
182
182
  ```python
183
183
  # Estimate cost before running
184
184
  estimate = await engine.estimate(
185
185
  file_size_mb=10.5,
186
186
  num_columns=25,
187
- depth_iterations=2,
187
+ analysis_depth=2,
188
188
  visibility="private",
189
189
  )
190
190
  # estimate["cost"]["credits"] -> 21
@@ -1,6 +1,6 @@
1
1
  """Disco Python SDK."""
2
2
 
3
- __version__ = "0.2.89"
3
+ __version__ = "0.2.90"
4
4
 
5
5
  from discovery.client import Engine
6
6
  from discovery.types import (
@@ -219,7 +219,7 @@ class Engine:
219
219
  self,
220
220
  file: Union[str, Path, "pd.DataFrame"],
221
221
  target_column: str,
222
- depth_iterations: int = 2,
222
+ analysis_depth: int = 2,
223
223
  visibility: str = "public",
224
224
  title: Optional[str] = None,
225
225
  description: Optional[str] = None,
@@ -237,7 +237,7 @@ class Engine:
237
237
  Args:
238
238
  file: File path, Path object, or pandas DataFrame.
239
239
  target_column: Column to analyze (what drives it up or down?).
240
- depth_iterations: 1=fast, higher=deeper pattern search (max: num_columns - 2).
240
+ analysis_depth: 1=fast, higher=deeper pattern search (max: num_columns - 2).
241
241
  visibility: "public" (free, published) or "private" (costs credits).
242
242
  title: Optional dataset title.
243
243
  description: Optional dataset description.
@@ -259,7 +259,7 @@ class Engine:
259
259
  return await self.run_async(
260
260
  file=file,
261
261
  target_column=target_column,
262
- depth_iterations=depth_iterations,
262
+ analysis_depth=analysis_depth,
263
263
  visibility=visibility,
264
264
  title=title,
265
265
  description=description,
@@ -274,7 +274,7 @@ class Engine:
274
274
  self,
275
275
  file: Union[str, Path, "pd.DataFrame"],
276
276
  target_column: str,
277
- depth_iterations: int = 2,
277
+ analysis_depth: int = 2,
278
278
  visibility: str = "public",
279
279
  title: Optional[str] = None,
280
280
  description: Optional[str] = None,
@@ -288,7 +288,7 @@ class Engine:
288
288
  self.discover(
289
289
  file=file,
290
290
  target_column=target_column,
291
- depth_iterations=depth_iterations,
291
+ analysis_depth=analysis_depth,
292
292
  visibility=visibility,
293
293
  title=title,
294
294
  description=description,
@@ -382,7 +382,7 @@ class Engine:
382
382
  file_size_mb: float,
383
383
  num_columns: int,
384
384
  num_rows: Optional[int] = None,
385
- depth_iterations: int = 2,
385
+ analysis_depth: int = 2,
386
386
  visibility: str = "public",
387
387
  ) -> Dict[str, Any]:
388
388
  """Estimate cost and time for an analysis run.
@@ -394,7 +394,7 @@ class Engine:
394
394
  file_size_mb: Size of the data file in megabytes.
395
395
  num_columns: Number of columns in the dataset.
396
396
  num_rows: Number of rows (improves time estimate accuracy).
397
- depth_iterations: Depth iterations (1=fast, higher=deeper).
397
+ analysis_depth: Depth iterations (1=fast, higher=deeper).
398
398
  visibility: "public" (free, results published) or "private" (costs credits).
399
399
 
400
400
  Returns:
@@ -407,7 +407,7 @@ class Engine:
407
407
  "file_size_mb": file_size_mb,
408
408
  "num_columns": num_columns,
409
409
  "num_rows": num_rows,
410
- "depth_iterations": depth_iterations,
410
+ "analysis_depth": analysis_depth,
411
411
  "visibility": visibility,
412
412
  },
413
413
  )
@@ -739,7 +739,7 @@ class Engine:
739
739
  self,
740
740
  file: Union[str, Path, "pd.DataFrame"],
741
741
  target_column: str,
742
- depth_iterations: int = 2,
742
+ analysis_depth: int = 2,
743
743
  title: Optional[str] = None,
744
744
  description: Optional[str] = None,
745
745
  column_descriptions: Optional[Dict[str, str]] = None,
@@ -763,7 +763,7 @@ class Engine:
763
763
  Args:
764
764
  file: File path, Path object, or pandas DataFrame.
765
765
  target_column: Name of the target column.
766
- depth_iterations: Analysis depth (default 2). Higher = deeper pattern search.
766
+ analysis_depth: Analysis depth (default 2). Higher = deeper pattern search.
767
767
  title: Optional dataset title.
768
768
  description: Optional dataset description.
769
769
  column_descriptions: Dict mapping column names to descriptions.
@@ -779,18 +779,18 @@ class Engine:
779
779
  EngineResult with run_id and (if wait=True) complete results.
780
780
  """
781
781
  # Public runs are capped at depth=2 (server enforces this)
782
- if depth_iterations > 2 and visibility == "public":
782
+ if analysis_depth > 2 and visibility == "public":
783
783
  self._log(
784
784
  "Public runs are capped at depth=2. Upgrade your plan at disco.leap-labs.com/subscribe "
785
785
  "for deeper analysis and priority processing."
786
786
  )
787
- depth_iterations = 2
787
+ analysis_depth = 2
788
788
 
789
789
  if upload_result:
790
790
  uploaded_file = upload_result["file"]
791
791
  columns = upload_result.get("columns", [])
792
792
  self._log(
793
- f"Creating run from pre-uploaded file (depth: {depth_iterations}, target: {target_column})..."
793
+ f"Creating run from pre-uploaded file (depth: {analysis_depth}, target: {target_column})..."
794
794
  )
795
795
  else:
796
796
  file_content, filename, mime_type, _ = self._prepare_upload(
@@ -825,7 +825,7 @@ class Engine:
825
825
  },
826
826
  "columns": columns,
827
827
  "targetColumn": target_column,
828
- "depthIterations": depth_iterations,
828
+ "analysisDepth": analysis_depth,
829
829
  "isPublic": visibility == "public",
830
830
  }
831
831
 
@@ -896,7 +896,7 @@ class Engine:
896
896
  self,
897
897
  file: Union[str, Path, "pd.DataFrame"],
898
898
  target_column: str,
899
- depth_iterations: int = 2,
899
+ analysis_depth: int = 2,
900
900
  title: Optional[str] = None,
901
901
  description: Optional[str] = None,
902
902
  column_descriptions: Optional[Dict[str, str]] = None,
@@ -916,7 +916,7 @@ class Engine:
916
916
  self.run_async(
917
917
  file,
918
918
  target_column,
919
- depth_iterations,
919
+ analysis_depth,
920
920
  title=title,
921
921
  description=description,
922
922
  column_descriptions=column_descriptions,
@@ -33,7 +33,7 @@ class DiscoveryEngineTool(BaseTool):
33
33
  "validated patterns that you cannot find with pandas, SQL, or by prompting "
34
34
  "an LLM to analyze data. Use when you need to go beyond correlation. "
35
35
  "Input: JSON with 'file' (path), 'target_column' (column to analyze). "
36
- "Optional: 'visibility' (public/private), 'depth_iterations' (search depth). "
36
+ "Optional: 'visibility' (public/private), 'analysis_depth' (search depth). "
37
37
  "Returns patterns with conditions, p-values, novelty scores, citations."
38
38
  )
39
39
  api_key: str = Field(description="Disco API key (disco_...)")
@@ -57,7 +57,7 @@ class DiscoveryEngineTool(BaseTool):
57
57
  result = engine.discover_sync(
58
58
  file=file_path,
59
59
  target_column=target_column,
60
- depth_iterations=params.get("depth_iterations", 2),
60
+ analysis_depth=params.get("analysis_depth", 2),
61
61
  visibility=params.get("visibility", "public"),
62
62
  )
63
63
  except Exception as e:
@@ -36,7 +36,7 @@ class DiscoveryEngineTool(BaseTool):
36
36
  "and find things nobody thought to look for. "
37
37
  "Input should be a JSON string with keys: "
38
38
  '"file" (path to CSV/Excel/Parquet), "target_column" (column to analyze). '
39
- 'Optional: "visibility" (public/private), "depth_iterations" (search depth). '
39
+ 'Optional: "visibility" (public/private), "analysis_depth" (search depth). '
40
40
  "Returns structured patterns with conditions, p-values, novelty scores, "
41
41
  "and citations."
42
42
  )
@@ -66,7 +66,7 @@ class DiscoveryEngineTool(BaseTool):
66
66
  result = await engine.discover(
67
67
  file=file_path,
68
68
  target_column=target_column,
69
- depth_iterations=params.get("depth_iterations", 2),
69
+ analysis_depth=params.get("analysis_depth", 2),
70
70
  visibility=params.get("visibility", "public"),
71
71
  )
72
72
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "discovery-engine-api"
3
- version = "0.2.89"
3
+ version = "0.2.90"
4
4
  description = "Python SDK for Disco API"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"