datalegion-cli 1.6.0__tar.gz → 1.7.0__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.
Files changed (30) hide show
  1. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/PKG-INFO +1 -1
  2. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/pyproject.toml +1 -1
  3. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/commands/company.py +7 -3
  4. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/commands/person.py +7 -3
  5. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_commands.py +26 -0
  6. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/.gitignore +0 -0
  7. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/LICENSE +0 -0
  8. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/README.md +0 -0
  9. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/__init__.py +0 -0
  10. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/async_typer.py +0 -0
  11. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/client.py +0 -0
  12. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/commands/__init__.py +0 -0
  13. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/commands/credits.py +0 -0
  14. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/commands/utility.py +0 -0
  15. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/config.py +0 -0
  16. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/logging.py +0 -0
  17. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/login.py +0 -0
  18. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/main.py +0 -0
  19. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/output.py +0 -0
  20. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/src/datalegion_cli/update.py +0 -0
  21. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/__init__.py +0 -0
  22. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/conftest.py +0 -0
  23. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_client.py +0 -0
  24. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_config.py +0 -0
  25. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_live.py +0 -0
  26. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_logging.py +0 -0
  27. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_login.py +0 -0
  28. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_output.py +0 -0
  29. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_package_contents.py +0 -0
  30. {datalegion_cli-1.6.0 → datalegion_cli-1.7.0}/tests/test_update.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: datalegion-cli
3
- Version: 1.6.0
3
+ Version: 1.7.0
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "datalegion-cli"
3
- version = "1.6.0"
3
+ version = "1.7.0"
4
4
  description = "CLI for the Data Legion API — agent-friendly, fully async"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -29,7 +29,11 @@ MinConfidence = Annotated[
29
29
  typer.Option("--min-confidence", help="Minimum confidence: high, moderate, low."),
30
30
  ]
31
31
  RequiredFields = Annotated[
32
- str | None, typer.Option("--required", help="Comma-separated required fields.")
32
+ str | None,
33
+ typer.Option(
34
+ "--required",
35
+ help="Fields a match must have, with AND, OR and parentheses, e.g. 'domain AND socials'.",
36
+ ),
33
37
  ]
34
38
 
35
39
 
@@ -99,7 +103,7 @@ async def enrich(
99
103
  @async_command
100
104
  async def search(
101
105
  query: Annotated[str, typer.Argument(help="SQL SELECT query against the companies table.")],
102
- limit: LimitOpt = 10,
106
+ limit: LimitOpt = 1,
103
107
  titlecase: TitleOpt = False,
104
108
  include_fields: FieldsInclude = None,
105
109
  exclude_fields: FieldsExclude = None,
@@ -134,7 +138,7 @@ async def search(
134
138
  @async_command
135
139
  async def discover(
136
140
  query: Annotated[str, typer.Argument(help="Natural language company search query.")],
137
- limit: LimitOpt = 10,
141
+ limit: LimitOpt = 1,
138
142
  titlecase: TitleOpt = False,
139
143
  include_fields: FieldsInclude = None,
140
144
  exclude_fields: FieldsExclude = None,
@@ -29,7 +29,11 @@ MinConfidence = Annotated[
29
29
  typer.Option("--min-confidence", help="Minimum confidence: high, moderate, low."),
30
30
  ]
31
31
  RequiredFields = Annotated[
32
- str | None, typer.Option("--required", help="Comma-separated required fields.")
32
+ str | None,
33
+ typer.Option(
34
+ "--required",
35
+ help="Fields a match must have, with AND, OR and parentheses, e.g. 'work_email OR mobile_phone'.",
36
+ ),
33
37
  ]
34
38
 
35
39
 
@@ -125,7 +129,7 @@ async def enrich(
125
129
  @async_command
126
130
  async def search(
127
131
  query: Annotated[str, typer.Argument(help="SQL SELECT query against the people table.")],
128
- limit: LimitOpt = 10,
132
+ limit: LimitOpt = 1,
129
133
  titlecase: TitleOpt = False,
130
134
  include_fields: FieldsInclude = None,
131
135
  exclude_fields: FieldsExclude = None,
@@ -159,7 +163,7 @@ async def search(
159
163
  @async_command
160
164
  async def discover(
161
165
  query: Annotated[str, typer.Argument(help="Natural language search query.")],
162
- limit: LimitOpt = 10,
166
+ limit: LimitOpt = 1,
163
167
  titlecase: TitleOpt = False,
164
168
  include_fields: FieldsInclude = None,
165
169
  exclude_fields: FieldsExclude = None,
@@ -490,3 +490,29 @@ class TestSearchWarning:
490
490
  assert result.exit_code == 0
491
491
  assert json.loads(result.stdout) == {"matches": [], "total": 0}
492
492
  assert f"search warning: {warning}" in result.stderr
493
+
494
+
495
+ class TestSearchLimitDefault:
496
+ """search and discover send limit 1 unless --limit says otherwise (the API's default too)."""
497
+
498
+ @pytest.mark.parametrize(
499
+ "args",
500
+ [
501
+ ["person", "search", "SELECT * FROM people WHERE city = 'austin'"],
502
+ ["person", "discover", "engineers in austin"],
503
+ ["company", "search", "SELECT * FROM companies WHERE industry = 'banking'"],
504
+ ["company", "discover", "banks in austin"],
505
+ ],
506
+ )
507
+ def test_the_default_limit_is_one(self, monkeypatch, args):
508
+ _mock_config(monkeypatch)
509
+ sent: list[dict] = []
510
+
511
+ async def capture(self, method, endpoint, *, payload=None, params=None):
512
+ sent.append(payload or {})
513
+ return {"matches": [], "total": 0}
514
+
515
+ with patch("datalegion_cli.client.LegionClient.request", capture):
516
+ assert runner.invoke(app, args).exit_code == 0
517
+ assert runner.invoke(app, [*args, "--limit", "25"]).exit_code == 0
518
+ assert [p["limit"] for p in sent] == [1, 25]
File without changes
File without changes