databar 2.0.7__tar.gz → 2.0.8__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.
- {databar-2.0.7/src/databar.egg-info → databar-2.0.8}/PKG-INFO +1 -1
- {databar-2.0.7 → databar-2.0.8}/pyproject.toml +1 -1
- {databar-2.0.7 → databar-2.0.8}/src/databar/__init__.py +1 -1
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/_onboard.py +45 -1
- {databar-2.0.7 → databar-2.0.8}/src/databar/client.py +8 -1
- {databar-2.0.7 → databar-2.0.8/src/databar.egg-info}/PKG-INFO +1 -1
- {databar-2.0.7 → databar-2.0.8}/tests/test_cli.py +1 -1
- {databar-2.0.7 → databar-2.0.8}/LICENSE +0 -0
- {databar-2.0.7 → databar-2.0.8}/README.md +0 -0
- {databar-2.0.7 → databar-2.0.8}/setup.cfg +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/__init__.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/_auth.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/_guide.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/_output.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/app.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/enrichments.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/tables.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/tasks.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/cli/waterfalls.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/exceptions.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar/models.py +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar.egg-info/SOURCES.txt +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar.egg-info/dependency_links.txt +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar.egg-info/entry_points.txt +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar.egg-info/requires.txt +0 -0
- {databar-2.0.7 → databar-2.0.8}/src/databar.egg-info/top_level.txt +0 -0
- {databar-2.0.7 → databar-2.0.8}/tests/test_client.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "databar"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.8"
|
|
8
8
|
description = "Official Databar.ai Python SDK and CLI — connect to enrichments, waterfalls, and tables via api.databar.ai"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -6,7 +6,8 @@ Guides the user through:
|
|
|
6
6
|
2. API key entry & verification
|
|
7
7
|
3. PATH detection & optional auto-fix
|
|
8
8
|
4. Usage preference (CLI / Python SDK / both)
|
|
9
|
-
5.
|
|
9
|
+
5. Optional ~/.claude/CLAUDE.md registration for Claude Code
|
|
10
|
+
6. Tailored next-steps cheatsheet
|
|
10
11
|
"""
|
|
11
12
|
|
|
12
13
|
from __future__ import annotations
|
|
@@ -49,6 +50,11 @@ CONFIG_FILE = CONFIG_DIR / "config"
|
|
|
49
50
|
_KEY_PREFIX = "api_key="
|
|
50
51
|
_PREF_PREFIX = "preferred_interface="
|
|
51
52
|
|
|
53
|
+
CLAUDE_MD_DIR = Path.home() / ".claude"
|
|
54
|
+
CLAUDE_MD_FILE = CLAUDE_MD_DIR / "CLAUDE.md"
|
|
55
|
+
_CLAUDE_SENTINEL = "<!-- databar -->"
|
|
56
|
+
_CLAUDE_STUB = """\n<!-- databar -->\n## Databar\nWhen the user asks you to use Databar, always run `databar agent-guide` first\nto get the full usage guide before doing anything else.\n<!-- /databar -->\n"""
|
|
57
|
+
|
|
52
58
|
|
|
53
59
|
def _save_key(api_key: str) -> None:
|
|
54
60
|
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
|
|
@@ -224,6 +230,43 @@ def _step_preference() -> str:
|
|
|
224
230
|
return pref
|
|
225
231
|
|
|
226
232
|
|
|
233
|
+
def _step_claude_md() -> None:
|
|
234
|
+
"""Optionally register Databar in the user's global ~/.claude/CLAUDE.md."""
|
|
235
|
+
console.print("[bold]Step 4 — Claude Code integration (optional)[/bold]\n")
|
|
236
|
+
|
|
237
|
+
already = (
|
|
238
|
+
CLAUDE_MD_FILE.exists()
|
|
239
|
+
and _CLAUDE_SENTINEL in CLAUDE_MD_FILE.read_text()
|
|
240
|
+
)
|
|
241
|
+
if already:
|
|
242
|
+
console.print(
|
|
243
|
+
" [bold green]✓[/bold green] Databar is already registered in "
|
|
244
|
+
f"[dim]{CLAUDE_MD_FILE}[/dim].\n"
|
|
245
|
+
)
|
|
246
|
+
return
|
|
247
|
+
|
|
248
|
+
console.print(
|
|
249
|
+
f" Adding a small entry to [bold]{CLAUDE_MD_FILE}[/bold] tells Claude Code\n"
|
|
250
|
+
" to always run [bold]databar agent-guide[/bold] first, so it knows exactly\n"
|
|
251
|
+
" how to use Databar without guessing.\n"
|
|
252
|
+
)
|
|
253
|
+
add = Confirm.ask(
|
|
254
|
+
" Add Databar to your global Claude Code config (~/.claude/CLAUDE.md)?",
|
|
255
|
+
default=True,
|
|
256
|
+
)
|
|
257
|
+
if add:
|
|
258
|
+
CLAUDE_MD_DIR.mkdir(parents=True, exist_ok=True)
|
|
259
|
+
with open(CLAUDE_MD_FILE, "a") as f:
|
|
260
|
+
f.write(_CLAUDE_STUB)
|
|
261
|
+
console.print(
|
|
262
|
+
f" [bold green]✓[/bold green] Added to {CLAUDE_MD_FILE}.\n"
|
|
263
|
+
" Claude Code will now pick up Databar instructions automatically "
|
|
264
|
+
"in every project.\n"
|
|
265
|
+
)
|
|
266
|
+
else:
|
|
267
|
+
console.print(" [dim]Skipped.[/dim]\n")
|
|
268
|
+
|
|
269
|
+
|
|
227
270
|
def _step_next_steps(pref: str) -> None:
|
|
228
271
|
"""Print tailored next steps based on preference."""
|
|
229
272
|
console.print(Rule(style="cyan"))
|
|
@@ -283,6 +326,7 @@ def onboard() -> None:
|
|
|
283
326
|
_step_api_key()
|
|
284
327
|
_step_path()
|
|
285
328
|
pref = _step_preference()
|
|
329
|
+
_step_claude_md()
|
|
286
330
|
_step_next_steps(pref)
|
|
287
331
|
except (KeyboardInterrupt, typer.Abort):
|
|
288
332
|
console.print("\n\n[dim]Onboarding cancelled. Run `databar onboard` any time to restart.[/dim]")
|
|
@@ -87,10 +87,17 @@ class DatabarClient:
|
|
|
87
87
|
) -> None:
|
|
88
88
|
resolved_key = api_key or os.environ.get("DATABAR_API_KEY")
|
|
89
89
|
if not resolved_key:
|
|
90
|
-
|
|
90
|
+
import shutil
|
|
91
|
+
msg = (
|
|
91
92
|
"No API key provided. Pass api_key= or set the DATABAR_API_KEY "
|
|
92
93
|
"environment variable. Run `databar login` to save your key."
|
|
93
94
|
)
|
|
95
|
+
if shutil.which("databar") is not None:
|
|
96
|
+
msg += (
|
|
97
|
+
"\n\nUsing Databar with an AI agent (Claude Code, Cursor, etc.)? "
|
|
98
|
+
"Run `databar agent-guide` for agent-optimized setup instructions."
|
|
99
|
+
)
|
|
100
|
+
raise DatabarAuthError(msg)
|
|
94
101
|
self._api_key = resolved_key
|
|
95
102
|
self._base_url = base_url.rstrip("/")
|
|
96
103
|
self._timeout = timeout
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|