datalegion-cli 1.10.0__tar.gz → 1.10.2__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.
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/PKG-INFO +21 -19
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/README.md +20 -18
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/pyproject.toml +1 -1
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/commands/company.py +2 -2
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/commands/person.py +2 -2
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/main.py +1 -1
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_commands.py +3 -4
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/.gitignore +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/LICENSE +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/__init__.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/async_typer.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/client.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/commands/__init__.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/commands/credits.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/commands/utility.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/config.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/logging.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/login.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/output.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/src/datalegion_cli/update.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/__init__.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/conftest.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_client.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_config.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_live.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_logging.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_login.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_output.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_package_contents.py +0 -0
- {datalegion_cli-1.10.0 → datalegion_cli-1.10.2}/tests/test_update.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datalegion-cli
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.2
|
|
4
4
|
Summary: CLI for the Data Legion API — agent-friendly, fully async
|
|
5
5
|
Project-URL: Homepage, https://www.datalegion.ai
|
|
6
6
|
Project-URL: Documentation, https://www.datalegion.ai/docs
|
|
@@ -142,12 +142,12 @@ Config is stored at `~/.datalegion/config.toml`. Override the location with `LEG
|
|
|
142
142
|
|
|
143
143
|
The `update` command auto-detects how the CLI was installed:
|
|
144
144
|
|
|
145
|
-
| Method
|
|
146
|
-
|
|
147
|
-
| `brew`
|
|
148
|
-
| `github` | Set via config
|
|
149
|
-
| `git`
|
|
150
|
-
| `pip`
|
|
145
|
+
| Method | Detection | Update strategy |
|
|
146
|
+
| -------- | -------------------------------------------------------------------- | ------------------------------------------------- |
|
|
147
|
+
| `brew` | The running Python is the formula's own venv under Homebrew's Cellar | `brew upgrade` |
|
|
148
|
+
| `github` | Set via config | Downloads `.whl` from GitHub release |
|
|
149
|
+
| `git` | An editable install from a git checkout (its `direct_url.json`) | `git pull --ff-only` + `uv sync` in that checkout |
|
|
150
|
+
| `pip` | Default fallback | `uv pip install --upgrade` |
|
|
151
151
|
|
|
152
152
|
You can override detection by setting `install_method` in config. For pip installs from a private index, set the `LEGION_PIP_INDEX_URL` environment variable.
|
|
153
153
|
|
|
@@ -187,10 +187,12 @@ datalegion-cli person search --filters '{"job_title": ["vp of sales", "head of s
|
|
|
187
187
|
datalegion-cli person search --filters '{"and": [{"keywords": "(\"data engineer\" OR analyst) AND python NOT intern"}, {"or": [{"state_code": "TX"}, {"city": "boston"}]}]}' --limit 10
|
|
188
188
|
|
|
189
189
|
# SQL, or a query object in the Elasticsearch query syntax
|
|
190
|
-
datalegion-cli person search --sql "SELECT * FROM people WHERE company_name ILIKE '%google%' AND
|
|
190
|
+
datalegion-cli person search --sql "SELECT * FROM people WHERE company_name ILIKE '%google%' AND job_title ILIKE '%engineer%'" --limit 5
|
|
191
191
|
datalegion-cli person search --es-query '{"bool": {"filter": [{"term": {"company_name": "google"}}, {"match": {"job_title": "engineer"}}]}}' --limit 100
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
+
Location fields (`city`, `state`, `state_code`) come with contact data; on a plan without it, a filter on them is refused with a 400.
|
|
195
|
+
|
|
194
196
|
For deep paging, pass each page's `next_cursor` back with `--cursor`; the last page has none. Company search takes the same inputs.
|
|
195
197
|
|
|
196
198
|
```bash
|
|
@@ -202,13 +204,13 @@ datalegion-cli person search --filters '{"state_code": "OH"}' --limit 100 --curs
|
|
|
202
204
|
`count` takes what `search` takes and prints how many records match, rounded, without returning any. It is free and works with zero credits left: it needs an active plan that includes search (10 a minute and 100 an hour; 5 and 30 on a free trial). Fields that identify one record (ids, names, emails, phones, URLs, domains, tickers) are refused: use `enrich` for one record.
|
|
203
205
|
|
|
204
206
|
```bash
|
|
205
|
-
datalegion-cli person count --filters '{"job_title": "nurse practitioner", "
|
|
206
|
-
# {"total":
|
|
207
|
+
datalegion-cli person count --filters '{"job_title": "nurse practitioner", "company_industry": "hospitals and health care"}'
|
|
208
|
+
# {"total": 110000, "total_status": "about"}
|
|
207
209
|
```
|
|
208
210
|
|
|
209
211
|
`total_status` is `about`, `at_least` (counting ran out of time: a lower bound) or `under` (fewer than 10).
|
|
210
212
|
|
|
211
|
-
### Person
|
|
213
|
+
### Person Discover (Beta)
|
|
212
214
|
|
|
213
215
|
```bash
|
|
214
216
|
# Natural-language search
|
|
@@ -252,7 +254,7 @@ datalegion-cli company search --sql "SELECT * FROM companies WHERE industry ILIK
|
|
|
252
254
|
datalegion-cli company count --filters '{"industry": "banking", "locations.country_code": "GB"}'
|
|
253
255
|
```
|
|
254
256
|
|
|
255
|
-
### Company
|
|
257
|
+
### Company Discover (Beta)
|
|
256
258
|
|
|
257
259
|
```bash
|
|
258
260
|
# Natural-language search
|
|
@@ -320,7 +322,7 @@ datalegion-cli person enrich --email bad 2>/dev/null
|
|
|
320
322
|
|
|
321
323
|
## Sandbox
|
|
322
324
|
|
|
323
|
-
Try commands without spending credits: `--sandbox` (or `LEGION_SANDBOX=1`, or `datalegion-cli config set sandbox true`) makes
|
|
325
|
+
Try commands without spending credits: `--sandbox` (or `LEGION_SANDBOX=1`, or `datalegion-cli config set sandbox true`) makes Enrichment, Search and Discover return sample records with every field a real record has. Utilities, which are free, still call the real API. Sandbox Discover answers only a few fixed example queries.
|
|
324
326
|
|
|
325
327
|
```bash
|
|
326
328
|
datalegion-cli --sandbox person enrich --email anyone@example.com
|
|
@@ -328,12 +330,12 @@ datalegion-cli --sandbox person enrich --email anyone@example.com
|
|
|
328
330
|
|
|
329
331
|
## Global Flags
|
|
330
332
|
|
|
331
|
-
| Flag
|
|
332
|
-
|
|
333
|
-
| `--verbose` / `-v` | Enable debug logging to stderr
|
|
334
|
-
| `--quiet` / `-q`
|
|
335
|
-
| `--sandbox`
|
|
336
|
-
| `--help`
|
|
333
|
+
| Flag | Description |
|
|
334
|
+
| ------------------ | ---------------------------------------------------------------------------- |
|
|
335
|
+
| `--verbose` / `-v` | Enable debug logging to stderr |
|
|
336
|
+
| `--quiet` / `-q` | Suppress all log output |
|
|
337
|
+
| `--sandbox` | Return sample records from Enrichment, Search and Discover, using no credits |
|
|
338
|
+
| `--help` | Show help for any command |
|
|
337
339
|
|
|
338
340
|
## Development
|
|
339
341
|
|
|
@@ -107,12 +107,12 @@ Config is stored at `~/.datalegion/config.toml`. Override the location with `LEG
|
|
|
107
107
|
|
|
108
108
|
The `update` command auto-detects how the CLI was installed:
|
|
109
109
|
|
|
110
|
-
| Method
|
|
111
|
-
|
|
112
|
-
| `brew`
|
|
113
|
-
| `github` | Set via config
|
|
114
|
-
| `git`
|
|
115
|
-
| `pip`
|
|
110
|
+
| Method | Detection | Update strategy |
|
|
111
|
+
| -------- | -------------------------------------------------------------------- | ------------------------------------------------- |
|
|
112
|
+
| `brew` | The running Python is the formula's own venv under Homebrew's Cellar | `brew upgrade` |
|
|
113
|
+
| `github` | Set via config | Downloads `.whl` from GitHub release |
|
|
114
|
+
| `git` | An editable install from a git checkout (its `direct_url.json`) | `git pull --ff-only` + `uv sync` in that checkout |
|
|
115
|
+
| `pip` | Default fallback | `uv pip install --upgrade` |
|
|
116
116
|
|
|
117
117
|
You can override detection by setting `install_method` in config. For pip installs from a private index, set the `LEGION_PIP_INDEX_URL` environment variable.
|
|
118
118
|
|
|
@@ -152,10 +152,12 @@ datalegion-cli person search --filters '{"job_title": ["vp of sales", "head of s
|
|
|
152
152
|
datalegion-cli person search --filters '{"and": [{"keywords": "(\"data engineer\" OR analyst) AND python NOT intern"}, {"or": [{"state_code": "TX"}, {"city": "boston"}]}]}' --limit 10
|
|
153
153
|
|
|
154
154
|
# SQL, or a query object in the Elasticsearch query syntax
|
|
155
|
-
datalegion-cli person search --sql "SELECT * FROM people WHERE company_name ILIKE '%google%' AND
|
|
155
|
+
datalegion-cli person search --sql "SELECT * FROM people WHERE company_name ILIKE '%google%' AND job_title ILIKE '%engineer%'" --limit 5
|
|
156
156
|
datalegion-cli person search --es-query '{"bool": {"filter": [{"term": {"company_name": "google"}}, {"match": {"job_title": "engineer"}}]}}' --limit 100
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
+
Location fields (`city`, `state`, `state_code`) come with contact data; on a plan without it, a filter on them is refused with a 400.
|
|
160
|
+
|
|
159
161
|
For deep paging, pass each page's `next_cursor` back with `--cursor`; the last page has none. Company search takes the same inputs.
|
|
160
162
|
|
|
161
163
|
```bash
|
|
@@ -167,13 +169,13 @@ datalegion-cli person search --filters '{"state_code": "OH"}' --limit 100 --curs
|
|
|
167
169
|
`count` takes what `search` takes and prints how many records match, rounded, without returning any. It is free and works with zero credits left: it needs an active plan that includes search (10 a minute and 100 an hour; 5 and 30 on a free trial). Fields that identify one record (ids, names, emails, phones, URLs, domains, tickers) are refused: use `enrich` for one record.
|
|
168
170
|
|
|
169
171
|
```bash
|
|
170
|
-
datalegion-cli person count --filters '{"job_title": "nurse practitioner", "
|
|
171
|
-
# {"total":
|
|
172
|
+
datalegion-cli person count --filters '{"job_title": "nurse practitioner", "company_industry": "hospitals and health care"}'
|
|
173
|
+
# {"total": 110000, "total_status": "about"}
|
|
172
174
|
```
|
|
173
175
|
|
|
174
176
|
`total_status` is `about`, `at_least` (counting ran out of time: a lower bound) or `under` (fewer than 10).
|
|
175
177
|
|
|
176
|
-
### Person
|
|
178
|
+
### Person Discover (Beta)
|
|
177
179
|
|
|
178
180
|
```bash
|
|
179
181
|
# Natural-language search
|
|
@@ -217,7 +219,7 @@ datalegion-cli company search --sql "SELECT * FROM companies WHERE industry ILIK
|
|
|
217
219
|
datalegion-cli company count --filters '{"industry": "banking", "locations.country_code": "GB"}'
|
|
218
220
|
```
|
|
219
221
|
|
|
220
|
-
### Company
|
|
222
|
+
### Company Discover (Beta)
|
|
221
223
|
|
|
222
224
|
```bash
|
|
223
225
|
# Natural-language search
|
|
@@ -285,7 +287,7 @@ datalegion-cli person enrich --email bad 2>/dev/null
|
|
|
285
287
|
|
|
286
288
|
## Sandbox
|
|
287
289
|
|
|
288
|
-
Try commands without spending credits: `--sandbox` (or `LEGION_SANDBOX=1`, or `datalegion-cli config set sandbox true`) makes
|
|
290
|
+
Try commands without spending credits: `--sandbox` (or `LEGION_SANDBOX=1`, or `datalegion-cli config set sandbox true`) makes Enrichment, Search and Discover return sample records with every field a real record has. Utilities, which are free, still call the real API. Sandbox Discover answers only a few fixed example queries.
|
|
289
291
|
|
|
290
292
|
```bash
|
|
291
293
|
datalegion-cli --sandbox person enrich --email anyone@example.com
|
|
@@ -293,12 +295,12 @@ datalegion-cli --sandbox person enrich --email anyone@example.com
|
|
|
293
295
|
|
|
294
296
|
## Global Flags
|
|
295
297
|
|
|
296
|
-
| Flag
|
|
297
|
-
|
|
298
|
-
| `--verbose` / `-v` | Enable debug logging to stderr
|
|
299
|
-
| `--quiet` / `-q`
|
|
300
|
-
| `--sandbox`
|
|
301
|
-
| `--help`
|
|
298
|
+
| Flag | Description |
|
|
299
|
+
| ------------------ | ---------------------------------------------------------------------------- |
|
|
300
|
+
| `--verbose` / `-v` | Enable debug logging to stderr |
|
|
301
|
+
| `--quiet` / `-q` | Suppress all log output |
|
|
302
|
+
| `--sandbox` | Return sample records from Enrichment, Search and Discover, using no credits |
|
|
303
|
+
| `--help` | Show help for any command |
|
|
302
304
|
|
|
303
305
|
## Development
|
|
304
306
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Company
|
|
1
|
+
"""Company Enrichment, Search and Discover commands."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ from datalegion_cli.commands import (
|
|
|
20
20
|
)
|
|
21
21
|
from datalegion_cli.output import emit_credits, emit_error, emit_json, emit_search_warning
|
|
22
22
|
|
|
23
|
-
app = typer.Typer(name="company", help="Company
|
|
23
|
+
app = typer.Typer(name="company", help="Company Enrichment, Search and Discover.")
|
|
24
24
|
|
|
25
25
|
# ── Shared options ───────────────────────────────────────────────────
|
|
26
26
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Person
|
|
1
|
+
"""Person Enrichment, Search and Discover commands."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ from datalegion_cli.commands import (
|
|
|
20
20
|
)
|
|
21
21
|
from datalegion_cli.output import emit_credits, emit_error, emit_json, emit_search_warning
|
|
22
22
|
|
|
23
|
-
app = typer.Typer(name="person", help="Person
|
|
23
|
+
app = typer.Typer(name="person", help="Person Enrichment, Search and Discover.")
|
|
24
24
|
|
|
25
25
|
# ── Shared options ───────────────────────────────────────────────────
|
|
26
26
|
|
|
@@ -41,7 +41,7 @@ def main_callback(
|
|
|
41
41
|
bool,
|
|
42
42
|
typer.Option(
|
|
43
43
|
"--sandbox",
|
|
44
|
-
help="Return sample records from
|
|
44
|
+
help="Return sample records from Enrichment, Search and Discover, using no credits.",
|
|
45
45
|
),
|
|
46
46
|
] = False,
|
|
47
47
|
) -> None:
|
|
@@ -208,7 +208,7 @@ class TestSearchQueryObjectAndCursor:
|
|
|
208
208
|
|
|
209
209
|
async def fake_request(self, method, endpoint, *, payload=None, params=None):
|
|
210
210
|
sent.append((endpoint, payload))
|
|
211
|
-
return {"matches": [], "total": 0, "next_cursor": "def"
|
|
211
|
+
return {"matches": [], "total": 0, "next_cursor": "def"}
|
|
212
212
|
|
|
213
213
|
monkeypatch.setattr("datalegion_cli.client.LegionClient.request", fake_request)
|
|
214
214
|
result = runner.invoke(app, [entity, "discover", "nurses in Ohio", "--cursor", "abc"])
|
|
@@ -292,7 +292,6 @@ class TestPersonDiscover:
|
|
|
292
292
|
response = {
|
|
293
293
|
"matches": [{"full_name": "Engineer"}],
|
|
294
294
|
"total": 1,
|
|
295
|
-
"generated_query": "SELECT...",
|
|
296
295
|
}
|
|
297
296
|
with _mock_client_request(response):
|
|
298
297
|
result = runner.invoke(
|
|
@@ -305,7 +304,7 @@ class TestPersonDiscover:
|
|
|
305
304
|
)
|
|
306
305
|
assert result.exit_code == 0
|
|
307
306
|
data = json.loads(result.stdout)
|
|
308
|
-
assert "
|
|
307
|
+
assert data["total"] == 1
|
|
309
308
|
|
|
310
309
|
|
|
311
310
|
# TODO: Uncomment when bulk enrichment is ready
|
|
@@ -377,7 +376,7 @@ class TestCompanySearch:
|
|
|
377
376
|
class TestCompanyDiscover:
|
|
378
377
|
def test_discover(self, monkeypatch):
|
|
379
378
|
_mock_config(monkeypatch)
|
|
380
|
-
response = {"matches": [{"name": "Startup"}], "total": 1
|
|
379
|
+
response = {"matches": [{"name": "Startup"}], "total": 1}
|
|
381
380
|
with _mock_client_request(response):
|
|
382
381
|
result = runner.invoke(app, ["company", "discover", "AI startups in SF"])
|
|
383
382
|
assert result.exit_code == 0
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|