splurge-dsv 2025.2.0__tar.gz → 2025.2.1__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 (22) hide show
  1. {splurge_dsv-2025.2.0/splurge_dsv.egg-info → splurge_dsv-2025.2.1}/PKG-INFO +1 -1
  2. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/pyproject.toml +1 -1
  3. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/__init__.py +1 -1
  4. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/cli.py +1 -1
  5. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/dsv.py +26 -2
  6. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/dsv_helper.py +51 -2
  7. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1/splurge_dsv.egg-info}/PKG-INFO +1 -1
  8. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/LICENSE +0 -0
  9. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/README.md +0 -0
  10. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/setup.cfg +0 -0
  11. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/__main__.py +0 -0
  12. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/exceptions.py +0 -0
  13. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/path_validator.py +0 -0
  14. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/safe_text_file_reader.py +0 -0
  15. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/safe_text_file_writer.py +0 -0
  16. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/string_tokenizer.py +0 -0
  17. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv/text_file_helper.py +0 -0
  18. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv.egg-info/SOURCES.txt +0 -0
  19. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv.egg-info/dependency_links.txt +0 -0
  20. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv.egg-info/entry_points.txt +0 -0
  21. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv.egg-info/requires.txt +0 -0
  22. {splurge_dsv-2025.2.0 → splurge_dsv-2025.2.1}/splurge_dsv.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splurge-dsv
3
- Version: 2025.2.0
3
+ Version: 2025.2.1
4
4
  Summary: A utility library for working with DSV (Delimited String Values) files
5
5
  Author: Jim Schilling
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "splurge-dsv"
7
- version = "2025.2.0"
7
+ version = "2025.2.1"
8
8
  description = "A utility library for working with DSV (Delimited String Values) files"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -60,7 +60,7 @@ from splurge_dsv.path_validator import PathValidator
60
60
  from splurge_dsv.string_tokenizer import StringTokenizer
61
61
  from splurge_dsv.text_file_helper import TextFileHelper
62
62
 
63
- __version__ = "2025.2.0"
63
+ __version__ = "2025.2.1"
64
64
  __author__ = "Jim Schilling"
65
65
  __license__ = "MIT"
66
66
 
@@ -161,7 +161,7 @@ def run_cli() -> int:
161
161
  chunk_count = 0
162
162
  total_rows = 0
163
163
 
164
- for chunk in dsv.parse_stream(file_path):
164
+ for chunk in dsv.parse_file_stream(file_path):
165
165
  chunk_count += 1
166
166
  total_rows += len(chunk)
167
167
  if args.output_format == "json":
@@ -17,6 +17,7 @@ Copyright (c) 2025 Jim Schilling
17
17
  """
18
18
 
19
19
  # Standard library imports
20
+ import warnings
20
21
  from collections.abc import Iterator
21
22
  from dataclasses import dataclass, fields
22
23
  from os import PathLike
@@ -230,7 +231,7 @@ class Dsv:
230
231
  skip_footer_rows=self.config.skip_footer_rows,
231
232
  )
232
233
 
233
- def parse_stream(self, file_path: PathLike[str] | str) -> Iterator[list[list[str]]]:
234
+ def parse_file_stream(self, file_path: PathLike[str] | str) -> Iterator[list[list[str]]]:
234
235
  """Stream-parse a DSV file, yielding chunks of parsed rows.
235
236
 
236
237
  The method yields lists of parsed rows (each row itself is a list of
@@ -243,7 +244,7 @@ class Dsv:
243
244
  Yields:
244
245
  Lists of parsed rows, each list containing up to ``chunk_size`` rows.
245
246
  """
246
- return DsvHelper.parse_stream(
247
+ return DsvHelper.parse_file_stream(
247
248
  file_path,
248
249
  delimiter=self.config.delimiter,
249
250
  strip=self.config.strip,
@@ -254,3 +255,26 @@ class Dsv:
254
255
  skip_footer_rows=self.config.skip_footer_rows,
255
256
  chunk_size=self.config.chunk_size,
256
257
  )
258
+
259
+ def parse_stream(self, file_path: PathLike[str] | str) -> Iterator[list[list[str]]]:
260
+ """Stream-parse a DSV file, yielding chunks of parsed rows.
261
+
262
+ The method yields lists of parsed rows (each row itself is a list of
263
+ strings). Chunk sizing is controlled by the bound configuration's
264
+ ``chunk_size`` value.
265
+
266
+ Args:
267
+ file_path: Path to the file to parse.
268
+
269
+ Yields:
270
+ Lists of parsed rows, each list containing up to ``chunk_size`` rows.
271
+
272
+ Deprecated: Use `parse_file_stream` instead. This method will be removed in a future release.
273
+ """
274
+ # Emit a DeprecationWarning to signal removal in a future release
275
+ warnings.warn(
276
+ "Dsv.parse_stream() is deprecated and will be removed in a future release; use Dsv.parse_file_stream() instead.",
277
+ DeprecationWarning,
278
+ stacklevel=2,
279
+ )
280
+ return Dsv.parse_file_stream(self, file_path)
@@ -9,6 +9,7 @@ This module is licensed under the MIT License.
9
9
  """
10
10
 
11
11
  # Standard library imports
12
+ import warnings
12
13
  from collections.abc import Iterator
13
14
  from os import PathLike
14
15
 
@@ -199,7 +200,7 @@ class DsvHelper:
199
200
  return cls.parses(chunk, delimiter=delimiter, strip=strip, bookend=bookend, bookend_strip=bookend_strip)
200
201
 
201
202
  @classmethod
202
- def parse_stream(
203
+ def parse_file_stream(
203
204
  cls,
204
205
  file_path: PathLike[str] | str,
205
206
  *,
@@ -213,7 +214,7 @@ class DsvHelper:
213
214
  chunk_size: int = DEFAULT_CHUNK_SIZE,
214
215
  ) -> Iterator[list[list[str]]]:
215
216
  """
216
- Stream-parse a DSV file in chunks of lines.
217
+ Stream-parse a DSV file into chunks of lines.
217
218
 
218
219
  Args:
219
220
  file_path (PathLike[str] | str): The path to the file to parse.
@@ -255,3 +256,51 @@ class DsvHelper:
255
256
  chunk_size=chunk_size,
256
257
  )
257
258
  )
259
+
260
+ @classmethod
261
+ def parse_stream(
262
+ cls,
263
+ file_path: PathLike[str] | str,
264
+ *,
265
+ delimiter: str,
266
+ strip: bool = DEFAULT_STRIP,
267
+ bookend: str | None = None,
268
+ bookend_strip: bool = DEFAULT_BOOKEND_STRIP,
269
+ encoding: str = DEFAULT_ENCODING,
270
+ skip_header_rows: int = DEFAULT_SKIP_HEADER_ROWS,
271
+ skip_footer_rows: int = DEFAULT_SKIP_FOOTER_ROWS,
272
+ chunk_size: int = DEFAULT_CHUNK_SIZE,
273
+ ) -> Iterator[list[list[str]]]:
274
+ """
275
+ Stream-parse a DSV file, yielding chunks of parsed rows.
276
+
277
+ The method yields lists of parsed rows (each row itself is a list of
278
+ strings). Chunk sizing is controlled by the bound configuration's
279
+ ``chunk_size`` value.
280
+
281
+ Args:
282
+ file_path: Path to the file to parse.
283
+
284
+ Yields:
285
+ Lists of parsed rows, each list containing up to ``chunk_size`` rows.
286
+
287
+ Deprecated: Use `parse_file_stream` instead. This method will be removed in a future release.
288
+ """
289
+ # Emit a DeprecationWarning to signal removal in a future release
290
+ warnings.warn(
291
+ "DsvHelper.parse_stream() is deprecated and will be removed in a future release; use DsvHelper.parse_file_stream() instead.",
292
+ DeprecationWarning,
293
+ stacklevel=2,
294
+ )
295
+
296
+ return cls.parse_file_stream(
297
+ file_path,
298
+ delimiter=delimiter,
299
+ strip=strip,
300
+ bookend=bookend,
301
+ bookend_strip=bookend_strip,
302
+ encoding=encoding,
303
+ skip_header_rows=skip_header_rows,
304
+ skip_footer_rows=skip_footer_rows,
305
+ chunk_size=chunk_size,
306
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splurge-dsv
3
- Version: 2025.2.0
3
+ Version: 2025.2.1
4
4
  Summary: A utility library for working with DSV (Delimited String Values) files
5
5
  Author: Jim Schilling
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes