deepctl-cmd-usage 0.1.10__tar.gz → 0.1.12__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-usage
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary: Usage command for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>
@@ -18,9 +18,49 @@ Requires-Dist: deepctl-core>=0.1.10
18
18
  Requires-Dist: deepctl-shared-utils>=0.1.10
19
19
  Requires-Dist: click>=8.0.0
20
20
  Requires-Dist: rich>=13.0.0
21
- Requires-Dist: deepgram-sdk>=3.0.0
21
+ Requires-Dist: deepgram-sdk>=7.5.0
22
22
  Requires-Dist: pydantic>=2.0.0
23
23
 
24
24
  # deepctl-cmd-usage
25
25
 
26
- Usage command for deepctl. This package is an internal component of deepctl and is not intended for standalone use.
26
+ > Part of [deepctl](https://github.com/deepgram/cli) — Official Deepgram CLI
27
+
28
+ Usage command for deepctl
29
+
30
+ ## Installation
31
+
32
+ This package is included with deepctl and does not need to be installed separately.
33
+
34
+ ### Install deepctl
35
+
36
+ ```bash
37
+ # Install with pip
38
+ pip install deepctl
39
+
40
+ # Or install with uv
41
+ uv tool install deepctl
42
+
43
+ # Or install with pipx
44
+ pipx install deepctl
45
+
46
+ # Or run without installing
47
+ uvx deepctl --help
48
+ pipx run deepctl --help
49
+ ```
50
+
51
+ ## Commands
52
+
53
+ | Command | Entry Point |
54
+ |---------|-------------|
55
+ | `deepctl usage` | `deepctl_cmd_usage.command:UsageCommand` |
56
+
57
+ ## Dependencies
58
+
59
+ - `click>=8.0.0`
60
+ - `rich>=13.0.0`
61
+ - `deepgram-sdk>=6.0.0rc2`
62
+ - `pydantic>=2.0.0`
63
+
64
+ ## License
65
+
66
+ MIT — see [LICENSE](../../LICENSE)
@@ -0,0 +1,43 @@
1
+ # deepctl-cmd-usage
2
+
3
+ > Part of [deepctl](https://github.com/deepgram/cli) — Official Deepgram CLI
4
+
5
+ Usage command for deepctl
6
+
7
+ ## Installation
8
+
9
+ This package is included with deepctl and does not need to be installed separately.
10
+
11
+ ### Install deepctl
12
+
13
+ ```bash
14
+ # Install with pip
15
+ pip install deepctl
16
+
17
+ # Or install with uv
18
+ uv tool install deepctl
19
+
20
+ # Or install with pipx
21
+ pipx install deepctl
22
+
23
+ # Or run without installing
24
+ uvx deepctl --help
25
+ pipx run deepctl --help
26
+ ```
27
+
28
+ ## Commands
29
+
30
+ | Command | Entry Point |
31
+ |---------|-------------|
32
+ | `deepctl usage` | `deepctl_cmd_usage.command:UsageCommand` |
33
+
34
+ ## Dependencies
35
+
36
+ - `click>=8.0.0`
37
+ - `rich>=13.0.0`
38
+ - `deepgram-sdk>=6.0.0rc2`
39
+ - `pydantic>=2.0.0`
40
+
41
+ ## License
42
+
43
+ MIT — see [LICENSE](../../LICENSE)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deepctl-cmd-usage"
7
- version = "0.1.10"
7
+ version = "0.1.12" # x-release-please-version
8
8
  description = "Usage command for deepctl"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -25,7 +25,7 @@ dependencies = [
25
25
  "deepctl-shared-utils>=0.1.10",
26
26
  "click>=8.0.0",
27
27
  "rich>=13.0.0",
28
- "deepgram-sdk>=3.0.0",
28
+ "deepgram-sdk>=7.5.0",
29
29
  "pydantic>=2.0.0",
30
30
  ]
31
31
 
@@ -30,6 +30,17 @@ class UsageCommand(BaseCommand):
30
30
  requires_project = True
31
31
  ci_friendly = True
32
32
 
33
+ examples = [
34
+ "dg usage",
35
+ "dg usage --days 30",
36
+ "dg usage --start 2025-01-01 --end 2025-01-31",
37
+ ]
38
+ agent_help = (
39
+ "View Deepgram API usage statistics for the current project. "
40
+ "Shows request counts and audio hours over a configurable date range. "
41
+ "Requires authentication and a project ID."
42
+ )
43
+
33
44
  def get_arguments(self) -> list[dict[str, Any]]:
34
45
  """Get command arguments and options."""
35
46
  return [
@@ -103,9 +114,7 @@ class UsageCommand(BaseCommand):
103
114
  console.print("[blue]Fetching usage for last month...[/blue]")
104
115
  elif current_month:
105
116
  start_date, end_date = self._get_current_month_range()
106
- console.print(
107
- "[blue]Fetching usage for current month...[/blue]"
108
- )
117
+ console.print("[blue]Fetching usage for current month...[/blue]")
109
118
  elif start_date or end_date:
110
119
  # Validate custom date range
111
120
  if start_date and not validate_date_format(start_date):
@@ -127,9 +136,7 @@ class UsageCommand(BaseCommand):
127
136
  else:
128
137
  # Default to current month
129
138
  start_date, end_date = self._get_current_month_range()
130
- console.print(
131
- "[blue]Fetching usage for current month...[/blue]"
132
- )
139
+ console.print("[blue]Fetching usage for current month...[/blue]")
133
140
 
134
141
  # Get usage data
135
142
  result = client.get_usage(project_id, start_date, end_date)
@@ -182,19 +189,11 @@ class UsageCommand(BaseCommand):
182
189
  # For SDK response objects, we need to access attributes
183
190
  # directly
184
191
  result_dict = {
185
- "results": (
186
- result.results if hasattr(result, "results") else []
187
- ),
188
- "start": (
189
- result.start
190
- if hasattr(result, "start")
191
- else start_date
192
- ),
192
+ "results": (result.results if hasattr(result, "results") else []),
193
+ "start": (result.start if hasattr(result, "start") else start_date),
193
194
  "end": result.end if hasattr(result, "end") else end_date,
194
195
  "project_id": (
195
- result.project_id
196
- if hasattr(result, "project_id")
197
- else ""
196
+ result.project_id if hasattr(result, "project_id") else ""
198
197
  ),
199
198
  }
200
199
  else:
@@ -236,16 +235,13 @@ class UsageCommand(BaseCommand):
236
235
 
237
236
  # Display summary
238
237
  console.print(
239
- f"\n[green]Usage Summary ({start_date} to "
240
- f"{end_date}):[/green]"
238
+ f"\n[green]Usage Summary ({start_date} to {end_date}):[/green]"
241
239
  )
242
240
  console.print(f" Total Hours: {total_hours:,.1f}")
243
241
  console.print(f" Total Requests: {total_requests:,}")
244
242
 
245
243
  if total_tts_characters > 0:
246
- console.print(
247
- f" TTS Characters: {total_tts_characters:,}"
248
- )
244
+ console.print(f" TTS Characters: {total_tts_characters:,}")
249
245
 
250
246
  if total_tokens_out > 0:
251
247
  console.print(f" Tokens Out: {total_tokens_out:,}")
@@ -268,17 +264,12 @@ class UsageCommand(BaseCommand):
268
264
  f"{item['tts'].get('characters', 0):,}"
269
265
  )
270
266
  console.print(
271
- f" TTS Requests: "
272
- f"{item['tts'].get('requests', 0):,}"
267
+ f" TTS Requests: {item['tts'].get('requests', 0):,}"
273
268
  )
274
269
 
275
- if (
276
- "tokens" in item
277
- and item["tokens"].get("out", 0) > 0
278
- ):
270
+ if "tokens" in item and item["tokens"].get("out", 0) > 0:
279
271
  console.print(
280
- f" Tokens Out: "
281
- f"{item['tokens'].get('out', 0):,}"
272
+ f" Tokens Out: {item['tokens'].get('out', 0):,}"
282
273
  )
283
274
 
284
275
  project_id = result_dict.get("project_id", "")
@@ -290,8 +281,7 @@ class UsageCommand(BaseCommand):
290
281
  )
291
282
  else:
292
283
  console.print(
293
- "[yellow]No usage data found for the specified "
294
- "period[/yellow]"
284
+ "[yellow]No usage data found for the specified period[/yellow]"
295
285
  )
296
286
  return BaseResult(status="info", message="No usage data found")
297
287
 
@@ -315,9 +305,7 @@ class UsageCommand(BaseCommand):
315
305
  self, usage_data: dict[str, Any], start_date: str, end_date: str
316
306
  ) -> None:
317
307
  """Display usage summary."""
318
- console.print(
319
- f"\n[green]Usage Summary ({start_date} to " f"{end_date}):[/green]"
320
- )
308
+ console.print(f"\n[green]Usage Summary ({start_date} to {end_date}):[/green]")
321
309
 
322
310
  # Try to extract common usage metrics
323
311
  total_requests = usage_data.get("requests", 0)
@@ -331,8 +319,7 @@ class UsageCommand(BaseCommand):
331
319
  if isinstance(total_duration, int | float):
332
320
  hours = total_duration / 3600
333
321
  console.print(
334
- f" Total Duration: {hours:.2f} hours "
335
- f"({total_duration:,} seconds)"
322
+ f" Total Duration: {hours:.2f} hours ({total_duration:,} seconds)"
336
323
  )
337
324
  else:
338
325
  console.print(f" Total Duration: {total_duration}")
@@ -350,13 +337,9 @@ class UsageCommand(BaseCommand):
350
337
  "breakdown",
351
338
  ]:
352
339
  if isinstance(value, int | float):
353
- console.print(
354
- f" {key.replace('_', ' ').title()}: " f"{value:,}"
355
- )
340
+ console.print(f" {key.replace('_', ' ').title()}: {value:,}")
356
341
  else:
357
- console.print(
358
- f" {key.replace('_', ' ').title()}: {value}"
359
- )
342
+ console.print(f" {key.replace('_', ' ').title()}: {value}")
360
343
 
361
344
  def _display_usage_details(self, usage_data: dict[str, Any]) -> None:
362
345
  """Display detailed usage breakdown."""
@@ -373,8 +356,7 @@ class UsageCommand(BaseCommand):
373
356
  for key, value in data.items():
374
357
  if isinstance(value, int | float):
375
358
  console.print(
376
- f" {key.replace('_', ' ').title()}: "
377
- f"{value:,}"
359
+ f" {key.replace('_', ' ').title()}: {value:,}"
378
360
  )
379
361
  else:
380
362
  console.print(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-cmd-usage
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary: Usage command for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>
@@ -18,9 +18,49 @@ Requires-Dist: deepctl-core>=0.1.10
18
18
  Requires-Dist: deepctl-shared-utils>=0.1.10
19
19
  Requires-Dist: click>=8.0.0
20
20
  Requires-Dist: rich>=13.0.0
21
- Requires-Dist: deepgram-sdk>=3.0.0
21
+ Requires-Dist: deepgram-sdk>=7.5.0
22
22
  Requires-Dist: pydantic>=2.0.0
23
23
 
24
24
  # deepctl-cmd-usage
25
25
 
26
- Usage command for deepctl. This package is an internal component of deepctl and is not intended for standalone use.
26
+ > Part of [deepctl](https://github.com/deepgram/cli) — Official Deepgram CLI
27
+
28
+ Usage command for deepctl
29
+
30
+ ## Installation
31
+
32
+ This package is included with deepctl and does not need to be installed separately.
33
+
34
+ ### Install deepctl
35
+
36
+ ```bash
37
+ # Install with pip
38
+ pip install deepctl
39
+
40
+ # Or install with uv
41
+ uv tool install deepctl
42
+
43
+ # Or install with pipx
44
+ pipx install deepctl
45
+
46
+ # Or run without installing
47
+ uvx deepctl --help
48
+ pipx run deepctl --help
49
+ ```
50
+
51
+ ## Commands
52
+
53
+ | Command | Entry Point |
54
+ |---------|-------------|
55
+ | `deepctl usage` | `deepctl_cmd_usage.command:UsageCommand` |
56
+
57
+ ## Dependencies
58
+
59
+ - `click>=8.0.0`
60
+ - `rich>=13.0.0`
61
+ - `deepgram-sdk>=6.0.0rc2`
62
+ - `pydantic>=2.0.0`
63
+
64
+ ## License
65
+
66
+ MIT — see [LICENSE](../../LICENSE)
@@ -2,5 +2,5 @@ deepctl-core>=0.1.10
2
2
  deepctl-shared-utils>=0.1.10
3
3
  click>=8.0.0
4
4
  rich>=13.0.0
5
- deepgram-sdk>=3.0.0
5
+ deepgram-sdk>=7.5.0
6
6
  pydantic>=2.0.0
@@ -1,3 +0,0 @@
1
- # deepctl-cmd-usage
2
-
3
- Usage command for deepctl. This package is an internal component of deepctl and is not intended for standalone use.