ccburn 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.
ccburn/display/gauges.py CHANGED
@@ -1,5 +1,7 @@
1
1
  """Progress bar gauges for ccburn TUI."""
2
2
 
3
+ import sys
4
+
3
5
  from rich.progress import ProgressBar
4
6
  from rich.style import Style
5
7
  from rich.table import Table
@@ -15,26 +17,48 @@ except ImportError:
15
17
  from ccburn.utils.formatting import format_reset_time, get_utilization_color
16
18
 
17
19
 
18
- def get_pace_emoji(utilization: float, budget_pace: float) -> str:
20
+ def _supports_emoji() -> bool:
21
+ """Detect if the console supports emoji characters.
22
+
23
+ Returns:
24
+ True if emoji are likely supported, False otherwise.
25
+ """
26
+ # Check if stdout encoding supports emoji
27
+ try:
28
+ encoding = getattr(sys.stdout, "encoding", None) or ""
29
+ if encoding.lower() in ("utf-8", "utf8"):
30
+ return True
31
+ # Try to encode an emoji to test
32
+ "🔥".encode(encoding)
33
+ return True
34
+ except (UnicodeEncodeError, LookupError):
35
+ return False
36
+
37
+
38
+ def get_pace_emoji(utilization: float, budget_pace: float, ascii_fallback: bool = False) -> str:
19
39
  """Get emoji indicator based on utilization vs budget pace.
20
40
 
21
41
  Args:
22
42
  utilization: Current utilization (0-1)
23
43
  budget_pace: Expected budget pace (0-1)
44
+ ascii_fallback: If True, use ASCII characters instead of emoji
24
45
 
25
46
  Returns:
26
47
  Emoji: 🧊 (behind), 🔥 (on pace), 🚨 (ahead)
48
+ ASCII: [_] (behind), [=] (on pace), [!] (ahead)
27
49
  """
50
+ use_ascii = ascii_fallback or not _supports_emoji()
51
+
28
52
  if budget_pace == 0:
29
- return "🔥"
53
+ return "[=]" if use_ascii else "🔥"
30
54
 
31
55
  ratio = utilization / budget_pace
32
56
  if ratio < 0.85:
33
- return "🧊" # Behind pace - ice cold, under budget
57
+ return "[_]" if use_ascii else "🧊" # Behind pace - ice cold, under budget
34
58
  elif ratio > 1.15:
35
- return "🚨" # Ahead of pace - alarm!
59
+ return "[!]" if use_ascii else "🚨" # Ahead of pace - alarm!
36
60
  else:
37
- return "🔥" # On pace - normal burn
61
+ return "[=]" if use_ascii else "🔥" # On pace - normal burn
38
62
 
39
63
 
40
64
  def create_header(limit_type: LimitType, limit_data: LimitData | None) -> Table:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ccburn
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Terminal-based Claude Code usage limit visualizer with real-time burn-up charts
5
5
  Author: JuanjoFuchs
6
6
  License-Expression: MIT
@@ -46,6 +46,9 @@ Dynamic: license-file
46
46
  [![Python](https://img.shields.io/pypi/pyversions/ccburn)](https://pypi.org/project/ccburn/)
47
47
  [![GitHub Release](https://img.shields.io/github/v/release/JuanjoFuchs/ccburn)](https://github.com/JuanjoFuchs/ccburn/releases)
48
48
  [![WinGet](https://img.shields.io/badge/WinGet-pending-yellow)](https://github.com/microsoft/winget-pkgs/pulls?q=is%3Apr+ccburn)
49
+ [![npm downloads](https://img.shields.io/npm/dt/ccburn?label=npm%20downloads)](https://www.npmjs.com/package/ccburn)
50
+ [![PyPI downloads](https://img.shields.io/pepy/dt/ccburn?label=pypi%20downloads)](https://pepy.tech/project/ccburn)
51
+ [![GitHub downloads](https://img.shields.io/github/downloads/JuanjoFuchs/ccburn/total?label=github%20downloads)](https://github.com/JuanjoFuchs/ccburn/releases)
49
52
  [![License](https://img.shields.io/github/license/JuanjoFuchs/ccburn)](LICENSE)
50
53
 
51
54
  <p align="center">
@@ -9,14 +9,14 @@ ccburn/data/models.py,sha256=Sd2T36gH6OaNHl9zRlnnQXI-ziBA8Gl6rPYQIzmr7G4,5403
9
9
  ccburn/data/usage_client.py,sha256=_dGwmI5vYPk4S-HUe2_fnTwSuAfTPaOFff7mKPFnhps,4570
10
10
  ccburn/display/__init__.py,sha256=aL7TV53kU5oxlIwJ8M17stG2aC6UeGB-pj2u5BOpegs,495
11
11
  ccburn/display/chart.py,sha256=HGDcMqaqyNtlQzV-d-gUOStq8qjpVt4EYvCIU6BTAx8,11983
12
- ccburn/display/gauges.py,sha256=DCRunsEtv1HflRkTZLwnNbVZhe47gCIH78p3gfqFwDo,8594
12
+ ccburn/display/gauges.py,sha256=fEFsqPNrbME3isX41f56NZRLLoF2a3ll6_tfU8G0lFA,9440
13
13
  ccburn/display/layout.py,sha256=UndPxyh32jWGdDgOZCvedz06WcKxYMSchLwpOkkXQKo,8093
14
14
  ccburn/utils/__init__.py,sha256=N6EzUX9hUJkuga_l9Ci3of1CWNtQgpNmMmNyY2DgYrg,1119
15
15
  ccburn/utils/calculator.py,sha256=QcFm5X-VWZzucHdInEjjqKV5oZaNsdpMgl8oKvHAQYc,6174
16
16
  ccburn/utils/formatting.py,sha256=MEVIohBmvSur0hcc67oyYRDooiUMf0rPa4LO1fc2Ud4,4174
17
- ccburn-0.2.1.dist-info/licenses/LICENSE,sha256=Qf2mqNi2qJ35JytfoTdR1SgYhZ2Mt4Ohcf-tu_MuYC0,1068
18
- ccburn-0.2.1.dist-info/METADATA,sha256=gnEPQbkE97in73KUywvp6hF7nrMUzYCG5Lvv1UU06ZI,6979
19
- ccburn-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- ccburn-0.2.1.dist-info/entry_points.txt,sha256=GfFQ5VusMR8RJ9meygqWjaErdmYsf_arbILzf64WjLU,43
21
- ccburn-0.2.1.dist-info/top_level.txt,sha256=SM8TwGQZqQKKIQObVWQkfpA0OI4gRut7bPl-iM3g5RI,7
22
- ccburn-0.2.1.dist-info/RECORD,,
17
+ ccburn-0.2.2.dist-info/licenses/LICENSE,sha256=Qf2mqNi2qJ35JytfoTdR1SgYhZ2Mt4Ohcf-tu_MuYC0,1068
18
+ ccburn-0.2.2.dist-info/METADATA,sha256=HnLVSePIkdJpyn66BIB7lj-TfyOmlBev_10-1yvsjJI,7373
19
+ ccburn-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ ccburn-0.2.2.dist-info/entry_points.txt,sha256=GfFQ5VusMR8RJ9meygqWjaErdmYsf_arbILzf64WjLU,43
21
+ ccburn-0.2.2.dist-info/top_level.txt,sha256=SM8TwGQZqQKKIQObVWQkfpA0OI4gRut7bPl-iM3g5RI,7
22
+ ccburn-0.2.2.dist-info/RECORD,,
File without changes