deepctl-cmd-read 0.0.2__tar.gz → 0.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-cmd-read
3
- Version: 0.0.2
3
+ Version: 0.5.0
4
4
  Summary: Read (text intelligence) command for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>
@@ -14,10 +14,11 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
- Requires-Dist: deepctl-core>=0.1.10
18
- Requires-Dist: click>=8.0.0
19
- Requires-Dist: rich>=13.0.0
20
- Requires-Dist: pydantic>=2.0.0
17
+ Requires-Dist: deepctl==0.5.0
18
+ Requires-Dist: deepctl-core==0.5.0
19
+ Requires-Dist: click<9,>=8.2.0
20
+ Requires-Dist: rich<16,>=13.0.0
21
+ Requires-Dist: pydantic<3,>=2.0.0
21
22
 
22
23
  # deepctl-cmd-read
23
24
 
@@ -54,9 +55,9 @@ pipx run deepctl --help
54
55
 
55
56
  ## Dependencies
56
57
 
57
- - `click>=8.0.0`
58
- - `rich>=13.0.0`
59
- - `pydantic>=2.0.0`
58
+ - `click>=8.2.0,<9`
59
+ - `rich>=13.0.0,<16`
60
+ - `pydantic>=2.0.0,<3`
60
61
 
61
62
  ## License
62
63
 
@@ -33,9 +33,9 @@ pipx run deepctl --help
33
33
 
34
34
  ## Dependencies
35
35
 
36
- - `click>=8.0.0`
37
- - `rich>=13.0.0`
38
- - `pydantic>=2.0.0`
36
+ - `click>=8.2.0,<9`
37
+ - `rich>=13.0.0,<16`
38
+ - `pydantic>=2.0.0,<3`
39
39
 
40
40
  ## License
41
41
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deepctl-cmd-read"
7
- version = "0.0.2" # x-release-please-version
7
+ version = "0.5.0" # x-release-please-version
8
8
  description = "Read (text intelligence) command for deepctl"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -21,10 +21,11 @@ classifiers = [
21
21
  keywords = ["deepgram", "cli", "text-intelligence", "nlp", "read"]
22
22
  requires-python = ">=3.10"
23
23
  dependencies = [
24
- "deepctl-core>=0.1.10",
25
- "click>=8.0.0",
26
- "rich>=13.0.0",
27
- "pydantic>=2.0.0",
24
+ "deepctl==0.5.0", # x-release-please-version
25
+ "deepctl-core==0.5.0", # x-release-please-version
26
+ "click>=8.2.0,<9",
27
+ "rich>=13.0.0,<16",
28
+ "pydantic>=2.0.0,<3",
28
29
  ]
29
30
 
30
31
  [project.scripts]
@@ -38,3 +39,7 @@ package-dir = { "" = "src" }
38
39
  [tool.setuptools.packages.find]
39
40
  where = ["src"]
40
41
  include = ["deepctl_cmd_read*"]
42
+
43
+ [tool.uv.sources]
44
+ deepctl = { workspace = true }
45
+ deepctl-core = { workspace = true }
@@ -12,12 +12,17 @@ from deepctl_core import (
12
12
  BaseResult,
13
13
  Config,
14
14
  DeepgramClient,
15
+ get_output_format,
16
+ get_status_console,
15
17
  )
16
18
  from rich.console import Console
17
19
 
18
20
  from .models import ReadResult
19
21
 
20
22
  console = Console()
23
+ # Status/progress chrome must never touch stdout, or it corrupts JSON/CSV
24
+ # output that callers pipe into jq and friends.
25
+ status_console = get_status_console()
21
26
 
22
27
 
23
28
  class ReadCommand(BaseCommand):
@@ -129,7 +134,7 @@ class ReadCommand(BaseCommand):
129
134
  intents = True
130
135
 
131
136
  try:
132
- console.print("[blue]Analyzing text...[/blue]")
137
+ status_console.print("[blue]Analyzing text...[/blue]")
133
138
 
134
139
  result = client.analyze_text(
135
140
  text=text,
@@ -143,7 +148,7 @@ class ReadCommand(BaseCommand):
143
148
  return self._display_results(result, sentiment, summarize, topics, intents)
144
149
 
145
150
  except Exception as e:
146
- console.print(f"[red]Error analyzing text:[/red] {e}")
151
+ status_console.print(f"[red]Error analyzing text:[/red] {e}")
147
152
  return BaseResult(status="error", message=str(e))
148
153
 
149
154
  def _display_results(
@@ -157,6 +162,11 @@ class ReadCommand(BaseCommand):
157
162
  results = result.get("results", {})
158
163
  read_result = ReadResult(status="success")
159
164
 
165
+ # Human display only in default mode. For json/yaml/csv the framework
166
+ # serialises the returned result to stdout, so anything printed here
167
+ # would corrupt output that callers pipe into jq.
168
+ show = get_output_format() == "default"
169
+
160
170
  # Summary
161
171
  if show_summary:
162
172
  summaries = results.get("summary", {})
@@ -164,8 +174,9 @@ class ReadCommand(BaseCommand):
164
174
  summaries.get("text", "") if isinstance(summaries, dict) else ""
165
175
  )
166
176
  if summary_text:
167
- console.print("\n[green]Summary:[/green]")
168
- console.print(f" {summary_text}")
177
+ if show:
178
+ console.print("\n[green]Summary:[/green]")
179
+ console.print(f" {summary_text}")
169
180
  read_result.summary = summary_text
170
181
 
171
182
  # Sentiment
@@ -175,9 +186,11 @@ class ReadCommand(BaseCommand):
175
186
  average = sentiments.get("average", {})
176
187
  sentiment_val = average.get("sentiment", "")
177
188
  sentiment_score = average.get("sentiment_score", 0.0)
178
- console.print(
179
- f"\n[green]Sentiment:[/green] {sentiment_val} ({sentiment_score:.2f})"
180
- )
189
+ if show:
190
+ console.print(
191
+ f"\n[green]Sentiment:[/green] "
192
+ f"{sentiment_val} ({sentiment_score:.2f})"
193
+ )
181
194
  read_result.sentiment = sentiment_val
182
195
  read_result.sentiment_score = float(sentiment_score)
183
196
 
@@ -188,7 +201,8 @@ class ReadCommand(BaseCommand):
188
201
  topics_data.get("segments", []) if isinstance(topics_data, dict) else []
189
202
  )
190
203
  if segments:
191
- console.print("\n[green]Topics:[/green]")
204
+ if show:
205
+ console.print("\n[green]Topics:[/green]")
192
206
  seen_topics: set[str] = set()
193
207
  for seg in segments:
194
208
  for topic in seg.get("topics", []):
@@ -196,7 +210,8 @@ class ReadCommand(BaseCommand):
196
210
  if topic_name and topic_name not in seen_topics:
197
211
  seen_topics.add(topic_name)
198
212
  confidence = topic.get("confidence_score", 0.0)
199
- console.print(f" • {topic_name} ({confidence:.0%})")
213
+ if show:
214
+ console.print(f" • {topic_name} ({confidence:.0%})")
200
215
  read_result.topics = segments
201
216
 
202
217
  # Intents
@@ -208,7 +223,8 @@ class ReadCommand(BaseCommand):
208
223
  else []
209
224
  )
210
225
  if segments:
211
- console.print("\n[green]Intents:[/green]")
226
+ if show:
227
+ console.print("\n[green]Intents:[/green]")
212
228
  seen_intents: set[str] = set()
213
229
  for seg in segments:
214
230
  for intent in seg.get("intents", []):
@@ -216,7 +232,8 @@ class ReadCommand(BaseCommand):
216
232
  if intent_name and intent_name not in seen_intents:
217
233
  seen_intents.add(intent_name)
218
234
  confidence = intent.get("confidence_score", 0.0)
219
- console.print(f" • {intent_name} ({confidence:.0%})")
235
+ if show:
236
+ console.print(f" • {intent_name} ({confidence:.0%})")
220
237
  read_result.intents = segments
221
238
 
222
239
  return read_result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-cmd-read
3
- Version: 0.0.2
3
+ Version: 0.5.0
4
4
  Summary: Read (text intelligence) command for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>
@@ -14,10 +14,11 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
- Requires-Dist: deepctl-core>=0.1.10
18
- Requires-Dist: click>=8.0.0
19
- Requires-Dist: rich>=13.0.0
20
- Requires-Dist: pydantic>=2.0.0
17
+ Requires-Dist: deepctl==0.5.0
18
+ Requires-Dist: deepctl-core==0.5.0
19
+ Requires-Dist: click<9,>=8.2.0
20
+ Requires-Dist: rich<16,>=13.0.0
21
+ Requires-Dist: pydantic<3,>=2.0.0
21
22
 
22
23
  # deepctl-cmd-read
23
24
 
@@ -54,9 +55,9 @@ pipx run deepctl --help
54
55
 
55
56
  ## Dependencies
56
57
 
57
- - `click>=8.0.0`
58
- - `rich>=13.0.0`
59
- - `pydantic>=2.0.0`
58
+ - `click>=8.2.0,<9`
59
+ - `rich>=13.0.0,<16`
60
+ - `pydantic>=2.0.0,<3`
60
61
 
61
62
  ## License
62
63
 
@@ -0,0 +1,5 @@
1
+ deepctl==0.5.0
2
+ deepctl-core==0.5.0
3
+ click<9,>=8.2.0
4
+ rich<16,>=13.0.0
5
+ pydantic<3,>=2.0.0
@@ -1,4 +0,0 @@
1
- deepctl-core>=0.1.10
2
- click>=8.0.0
3
- rich>=13.0.0
4
- pydantic>=2.0.0