dsv 0.12.9 → 0.12.10

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +10 -0
  3. data/TODO +39 -18
  4. data/lib/DSV/VERSION.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7171a2d2de4dba26f3e304ca3e0c216e9bb093a36cef1420629e9f936e644889
4
- data.tar.gz: 4ccf92f6000c7e5b9d82315babc17c816edd3df7587583eb79f2c16eb19125cb
3
+ metadata.gz: f88116d5530f25575975779af46933ddd7c67af651b2c61a3894b237b000950a
4
+ data.tar.gz: cd03ed4c4b47c12044387544346d8be13ac3f256f1263f135302134bf1ce429d
5
5
  SHA512:
6
- metadata.gz: 4727efe3e9571299914d4b6731169ac5a70eabd475176f06cb084dba35cfcc038420faf4740ad01bbedb9caea1b13ba21ed40a058f2699ca6f4fedf9ba47a0b1
7
- data.tar.gz: 6b6143f85e9c6106344fed384228433057eff0641a38eff9e6f823a2d905cca416284b7068f80ff26529feb02045fe09f323e689614012bd267d0783aec469ba
6
+ metadata.gz: 0a6e2477a6ff620bba7e5317af9ec1482f0effa853f3ac6f6074e1460170f201b0649db16c1ba67b87621546b986948678d4f6610f2623e29766cb9d948c227d
7
+ data.tar.gz: b9ad0b92bcf1ec1caee1604217005250411ac318014ceafb9384ceb70ae276f5d2e457e097a287dcbb5c9d9b668144e8a2c35194d9e7e2a9d28377c5aa3bf8b9
data/CHANGELOG CHANGED
@@ -1,5 +1,15 @@
1
1
  # dsv/CHANGELOG
2
2
 
3
+ ## 20261103
4
+
5
+ 0.12.10: ~ TODO, now grouped by release; + ROADMAP.md.
6
+
7
+ 1. ~ TODO: the jobs decided, by release: the fixes left for 0.12.x; modes as declarations in 0.13.0; streaming in 0.14.0; what 1.0 needs; speed and new options in 1.x.
8
+ 2. ~ TODO: 11, strict:, and 15, the malformed-quoting option, superseded by field_count: and :rfc_4180; 13, chunks, by a streaming each; 1, 6, 7 and the undecided parts of 2, to ROADMAP.md.
9
+ 3. + ROADMAP.md: the design, the boundary for 1.0, the version rule, the release sequence, and the themes after 1.0 with what is undecided in each.
10
+ 4. ~ lib/DSV/VERSION.rb: /0.12.9/0.12.10/.
11
+
12
+
3
13
  ## 20261028
4
14
 
5
15
  0.12.9: + DSV::UnterminatedQuote, raised where a quoted field does not close.
data/TODO CHANGED
@@ -1,25 +1,46 @@
1
1
  # TODO
2
2
 
3
- ## 0.12.x, before the gem is published
3
+ ## 0.12.x, fixes
4
4
 
5
- 1. A path is told from content by the call, not by a guess: .read, .foreach, .open and the other path-taking class methods take a path, .parse takes text, new keeps the guess with a switch to say which, and a path under a read mode that names no file raises rather than being read as text.
6
- 2. Selection as a keyword on the calls, only: or select:, columns: being taken; the positional form kept or retired; selected_columns: renamed to match.
7
- 3. The instance-level header_row accessor renamed headers?, the class-level header_row now being the row.
8
- 4. << to append a row and generate to build a string, the two writing calls a CSV user reaches for first.
5
+ 1. The class methods close what they open, an early exit included, and without a block return an Enumerator which opens the source afresh on each pass, as CSV.foreach does; collect, select, reject and detect without a block no longer raise.
6
+ 2. as_array: with a column selection: each('name') no longer raises TypeError, and read('name', as_array: true) gives only the columns selected. as_array: in the README, as the way to get Arrays as CSV gives them.
7
+ 3. Reading honours quote: given as a String, as writing does; DSV.parse_line honours quote:.
8
+ 4. A space as the column separator splits on each space, not as String#split(' ') does.
9
+ 5. :double back to 0.12.4's reading, undoing 0.12.5 item 2: a row not starting with a quote split plainly, one starting with a quote split on quote-separator-quote, and one which leaves a lone quote in a field read in full as wholly quoted. The README back to 0.12.3's wording.
10
+ 6. :single read, as :double is with a single quote.
11
+ 7. filter, a class-level alias of select.
12
+ 8. A String under a write mode taken as a path, so that a file not yet there can be written by name.
13
+ 9. The internals private.
9
14
 
10
- ## 0.13.0, speed
15
+ ## 0.13.0, modes as declarations
11
16
 
12
- 5. The saved-up speed change, with the evidence in the reconciliation: two string predicates in place of four regex matches per piece in split_csv; rows built by zip.to_h; a benchmark script in the repository against stdlib CSV, and the README's speed sentence written from its output. The scanner-based parser on the branch scanner-parser is judged here.
17
+ 10. An unknown quote mode, file mode or option raises ArgumentError, where each is ignored today.
18
+ 11. :mixed, the name of the default.
19
+ 12. A mode raises on a contradiction which costs nothing to see, every row alike, header included: under :double, a row not starting with a quote, and a bare field in a row read in full. Declaring :mixed reads such a row.
13
20
 
14
- ## Features, after
21
+ ## 0.14.0, streaming
15
22
 
16
- 6. Guessing, as a mode that runs once at construction on a sample of the first rows and feeds the same chooser as an explicit option, scanner only: the column separator, the one whose count is the same on every sampled row; whether the first row is a header, its columns' types differing from the rows beneath in the same way across columns; and, where there is no header, a header made from the data, each column named for what its values look like, integer, decimal, date, email, URL, phone, with a positional fallback, column_0, for text and a suffix where two columns share a class. Names come from what values look like, not what they mean; anything more is a schema, and another library's.
17
- 7. Templated ingestion: a template: option taking a whole-row Regexp with a capture per field, the group names being the column names, one match per row; an Array of separators as its writable special case, compiled into such a Regexp at construction and invertible for writing where a general template is not.
18
- 8. The duplicate-header modes as an option: keep all as an Array, the default; index, a, a.1; first; last; error. All derivations of the same columns map at header time, none costing anything per row.
19
- 9. Writing options: minimal quoting, a field quoted only where it holds a separator, a quote or a row terminator; a row terminator inside a field kept, quoted, or folded to a space; the encoding declared and a transcode offered with any loss marked.
20
- 10. Symbols and Strings interchangeable for column names, in a selection, a columns: list and a row's keys; today a String is required.
21
- 11. A strict: option, off by default, that raises on a row with more or fewer fields than the header; today a short row gets only the columns it has and a long row's excess lands under nil.
22
- 12. A line number in each parse error, found only when the error is raised, from the source's position at that moment, as UnterminatedQuote finds its; never counted as it goes, since counting costs time on every row for the sake of the rare one.
23
- 13. Chunked processing of a large file: a bounded number of rows at a time handed to a block, so that nothing needs the whole file in memory and a partial result can be acted on before the rest is read.
24
- 14. Checks, all of them after the above: strict: (13), column types, and whatever else proves wanted; correct and published comes first.
25
- 15. The rule for malformed quoting as an option, its name to be settled, perhaps one with strict: (11): the default, as now; a stricter one, under which a quote that does not open a field raises too, and :double raises on a row which is not what it promises rather than reading it as unspecified quoting does; and a lenient one, never raising, text after a closing quote kept and a field which does not close running to the end of the source.
23
+ 13. each yields each row as it is read and returns its receiver, so that detect and break stop reading and memory does not grow with the file; rows is no longer filled by each. Chunks come from each_slice. A source read once, start to end, with no rewind, so that a pipe or $stdin can be read: the header from the first row read, and the line of an error found by seeking only where the source can; a rewind left to r+ rewriting and first_row called alone.
24
+
25
+ ## 1.0
26
+
27
+ 14. A corpus in the tests, a day of NEMWEB's dispatch files trimmed and the RFC 4180 cases, each checked against stdlib CSV's rows.
28
+ 15. A benchmark script against stdlib CSV, and the README's speed sentence written from its output.
29
+ 16. README: every mode by example, and a table matching each to stdlib CSV's and Python's settings.
30
+
31
+ ## 1.x, speed, results unchanged
32
+
33
+ 17. A per-row fast path for the default: split, the fields bare or wrapped in two quotes unwrapped, any other row read in full.
34
+ 18. as_array: returning the split fields, rather than building a Hash and then an Array from it.
35
+ 19. The splitter chosen once, at construction, as row_renderer is for writing.
36
+ 20. Two string predicates in place of four regex matches per piece; rows built by zip.to_h; the scanner-based parser, at the tag scanner-parser-20261006, judged against the rest.
37
+
38
+ ## 1.x, features
39
+
40
+ 21. :rfc_4180, a quote mode reading what RFC 4180 allows as :mixed does and raising on what it forbids.
41
+ 22. field_count:, :header or an Integer, off by default: a row of another width raises.
42
+ 23. Writing: minimal quoting, a field quoted only where it holds a separator, a quote or a row terminator; a row terminator inside a field kept, quoted, or folded to a space; the encoding declared and a transcode offered with any loss marked.
43
+ 24. A line number in each parse error, found only when the error is raised, as UnterminatedQuote finds its, where the source can seek. line_numbers:, off by default, counts lines as it reads instead, for any source a pipe included: the read loop chosen once, at construction, as row_renderer is for writing, so that without it no row pays for the count.
44
+ 25. The instance-level header_row renamed headers?, kept as an alias; << to append a row and generate to build a string.
45
+ 26. Symbols and Strings interchangeable for column names, in a selection, a columns: list and a row's keys.
46
+ 27. The duplicate-header modes as an option: keep all as an Array, the default; index, a, a.1; first; last; error.
data/lib/DSV/VERSION.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # DSV::VERSION
3
3
 
4
4
  class DSV
5
- VERSION = '0.12.9'
5
+ VERSION = '0.12.10'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.9
4
+ version: 0.12.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran