progress-table 3.2.0__tar.gz → 3.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: progress-table
3
- Version: 3.2.0
3
+ Version: 3.2.2
4
4
  Summary: Display progress as a pretty table in the command line.
5
5
  Project-URL: Home, https://github.com/gahaalt/progress-table
6
6
  Project-URL: Documentation, https://github.com/sjmikler/progress-table/blob/main/docs
@@ -10,7 +10,7 @@ Supported features:
10
10
  """
11
11
 
12
12
  __license__ = "MIT"
13
- __version__ = "3.2.0"
13
+ __version__ = "3.2.2"
14
14
  __author__ = "Szymon Mikler"
15
15
 
16
16
  from progress_table.progress_table import ProgressTable, styles
@@ -130,34 +130,34 @@ class ProgressTable:
130
130
  DEFAULT_ROW_COLOR = None
131
131
 
132
132
  def __init__(
133
- self,
134
- *cols: str,
135
- columns: Iterable[str] = (),
136
- interactive: int = int(os.environ.get("PTABLE_INTERACTIVE", "2")),
137
- refresh_rate: int = 20,
138
- num_decimal_places: int = 4,
139
- default_column_width: int | None = None,
140
- default_column_color: ColorFormat = None,
141
- default_column_alignment: str | None = None,
142
- default_column_aggregate: str | None = None,
143
- default_header_color: ColorFormat = None,
144
- default_row_color: ColorFormat = None,
145
- pbar_show_throughput: bool = True,
146
- pbar_show_progress: bool = False,
147
- pbar_show_percents: bool = False,
148
- pbar_show_eta: bool = False,
149
- pbar_embedded: bool = True,
150
- pbar_style: str | styles.PbarStyleBase = "square",
151
- pbar_style_embed: str | styles.PbarStyleBase = "cdots",
152
- print_header_on_top: bool = True,
153
- print_header_every_n_rows: int = 30,
154
- custom_cell_format: Callable[[Any], str] | None = None,
155
- table_style: str | styles.TableStyleBase = "round",
156
- file: TextIO | list[TextIO] | tuple[TextIO] | None = None,
157
- # DEPRECATED ARGUMENTS
158
- custom_format: None = None,
159
- embedded_progress_bar: None = None,
160
- print_row_on_update: None = None,
133
+ self,
134
+ *cols: str,
135
+ columns: Iterable[str] = (),
136
+ interactive: int = int(os.environ.get("PTABLE_INTERACTIVE", "2")),
137
+ refresh_rate: int = 20,
138
+ num_decimal_places: int = 4,
139
+ default_column_width: int | None = None,
140
+ default_column_color: ColorFormat = None,
141
+ default_column_alignment: str | None = None,
142
+ default_column_aggregate: str | None = None,
143
+ default_header_color: ColorFormat = None,
144
+ default_row_color: ColorFormat = None,
145
+ pbar_show_throughput: bool = True,
146
+ pbar_show_progress: bool = False,
147
+ pbar_show_percents: bool = False,
148
+ pbar_show_eta: bool = False,
149
+ pbar_embedded: bool = True,
150
+ pbar_style: str | styles.PbarStyleBase = "square",
151
+ pbar_style_embed: str | styles.PbarStyleBase = "cdots",
152
+ print_header_on_top: bool = True,
153
+ print_header_every_n_rows: int = 30,
154
+ custom_cell_format: Callable[[Any], str] | None = None,
155
+ table_style: str | styles.TableStyleBase = "round",
156
+ file: TextIO | list[TextIO] | tuple[TextIO] | None = None,
157
+ # DEPRECATED ARGUMENTS
158
+ custom_format: None = None,
159
+ embedded_progress_bar: None = None,
160
+ print_row_on_update: None = None,
161
161
  ) -> None:
162
162
  """Progress Table instance.
163
163
 
@@ -306,13 +306,13 @@ class ProgressTable:
306
306
  ####################
307
307
 
308
308
  def add_column(
309
- self,
310
- name: str,
311
- *,
312
- width: int | None = None,
313
- color: ColorFormat = None,
314
- alignment: str | None = None,
315
- aggregate: None | str | Callable = None,
309
+ self,
310
+ name: str,
311
+ *,
312
+ width: int | None = None,
313
+ color: ColorFormat = None,
314
+ alignment: str | None = None,
315
+ aggregate: None | str | Callable = None,
316
316
  ) -> None:
317
317
  """Add column to the table.
318
318
 
@@ -392,14 +392,14 @@ class ProgressTable:
392
392
  self._set_all_display_rows_as_pending()
393
393
 
394
394
  def update(
395
- self,
396
- name: str,
397
- value: Any,
398
- *,
399
- row: int = -1,
400
- weight: float = 1.0,
401
- cell_color: ColorFormat = None,
402
- **column_kwds,
395
+ self,
396
+ name: str,
397
+ value: Any,
398
+ *,
399
+ row: int = -1,
400
+ weight: float = 1.0,
401
+ cell_color: ColorFormat = None,
402
+ **column_kwds,
403
403
  ) -> None:
404
404
  """Update value in the current row. More powerful than __setitem__.
405
405
 
@@ -491,17 +491,17 @@ class ProgressTable:
491
491
  return self._at_indexer
492
492
 
493
493
  def next_row(
494
- self,
495
- color: ColorFormat | dict[str, ColorFormat] = None,
496
- split: bool | None = None,
497
- header: bool | None = None,
494
+ self,
495
+ color: ColorFormat | dict[str, ColorFormat] = None,
496
+ split: bool | None = None,
497
+ header: bool | None = None,
498
498
  ) -> None:
499
499
  """End the current row."""
500
500
  # Force header if it wasn't printed for a long enough time
501
501
  if (
502
- header is None
503
- and len(self._data_rows) - self._previous_header_row_number >= self._print_header_every_n_rows
504
- and self._print_header_every_n_rows > 0
502
+ header is None
503
+ and len(self._data_rows) - self._previous_header_row_number >= self._print_header_every_n_rows
504
+ and self._print_header_every_n_rows > 0
505
505
  ):
506
506
  header = True
507
507
  header = header or False
@@ -864,7 +864,7 @@ class ProgressTable:
864
864
  raise KeyError(msg)
865
865
 
866
866
  reset = Style.RESET_ALL if color else ""
867
- maybe_overflow = self.table_style.cell_overflow if clipped else ' '
867
+ maybe_overflow = self.table_style.cell_overflow if clipped else " "
868
868
  return f"{color} {str_value}{maybe_overflow}{reset}"
869
869
 
870
870
  def _get_outer_inner_width(self) -> int:
@@ -960,21 +960,21 @@ class ProgressTable:
960
960
  ##################
961
961
 
962
962
  def pbar(
963
- self,
964
- iterable: Iterable | int,
965
- *range_args,
966
- position=None,
967
- static=False,
968
- total=None,
969
- description="",
970
- show_throughput: bool | None = None,
971
- show_progress: bool | None = None,
972
- show_percents: bool | None = None,
973
- show_eta: bool | None = None,
974
- style=None,
975
- style_embed=None,
976
- color=None,
977
- color_empty=None,
963
+ self,
964
+ iterable: Iterable | int,
965
+ *range_args,
966
+ position=None,
967
+ static=False,
968
+ total=None,
969
+ description="",
970
+ show_throughput: bool | None = None,
971
+ show_progress: bool | None = None,
972
+ show_percents: bool | None = None,
973
+ show_eta: bool | None = None,
974
+ style=None,
975
+ style_embed=None,
976
+ color=None,
977
+ color_empty=None,
978
978
  ) -> TableProgressBar:
979
979
  """Create iterable progress bar object.
980
980
 
@@ -1041,22 +1041,22 @@ class ProgressTable:
1041
1041
 
1042
1042
  class TableProgressBar:
1043
1043
  def __init__(
1044
- self,
1045
- iterable,
1046
- *,
1047
- table,
1048
- total,
1049
- style,
1050
- style_embed,
1051
- color,
1052
- color_empty,
1053
- position,
1054
- static,
1055
- description,
1056
- show_throughput: bool,
1057
- show_progress: bool,
1058
- show_percents: bool,
1059
- show_eta: bool,
1044
+ self,
1045
+ iterable,
1046
+ *,
1047
+ table,
1048
+ total,
1049
+ style,
1050
+ style_embed,
1051
+ color,
1052
+ color_empty,
1053
+ position,
1054
+ static,
1055
+ description,
1056
+ show_throughput: bool,
1057
+ show_progress: bool,
1058
+ show_percents: bool,
1059
+ show_eta: bool,
1060
1060
  ) -> None:
1061
1061
  self.iterable: Iterable | None = iterable
1062
1062
 
@@ -1171,7 +1171,7 @@ class TableProgressBar:
1171
1171
  num_empty = inner_width - num_filled
1172
1172
 
1173
1173
  if embed_str is not None:
1174
- row_str = embed_str[1 + len(infobar):]
1174
+ row_str = embed_str[1 + len(infobar) :]
1175
1175
 
1176
1176
  filled_part = row_str[:num_filled]
1177
1177
  if len(filled_part) > 0 and filled_part[-1] == " ":
File without changes