TSVZ 4.3__tar.gz → 4.5__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: TSVZ
3
- Version: 4.3
3
+ Version: 4.5
4
4
  Summary: Key-value store kept in a TSV / CSV / NSV / PSV file, with tsvz-spec-v1 support
5
5
  Home-page: https://github.com/yufei-pan/TSVZ
6
6
  Author: Yufei Pan
@@ -34,7 +34,7 @@ key-value store in a delimiter-separated text file**. The first column of each
34
34
  row is the key; the file behaves like an ordered dictionary that is persisted to
35
35
  disk as you change it.
36
36
 
37
- **Version 4.3**, Python **3.6+**, one self-contained module (`TSVZ.py`): drop it
37
+ **Version 4.5**, Python **3.6+**, one self-contained module (`TSVZ.py`): drop it
38
38
  next to your code and `import TSVZ`, or install it.
39
39
 
40
40
  ```bash
@@ -51,7 +51,9 @@ pip install -e . # editable, from this directory
51
51
 
52
52
  The delimiter follows the extension: tab, comma, NUL, pipe. A trailing
53
53
  compression suffix (`.gz`, `.bz2`, `.xz`, `.zst`) is allowed on both; `.zst`
54
- needs Python 3.14.
54
+ needs Python 3.14. For important or sensitive data, keep the part you write to
55
+ uncompressed and compress parts once they no longer change: a damaged
56
+ compressed member can lose every record in it (spec §16.4.2).
55
57
 
56
58
  `TSVZed`, `TSVZedLite`, `readTabularFile`, `appendTabularFile`,
57
59
  `appendLinesTabularFile`, `clearTabularFile`, `scrubTabularFile` (and the
@@ -203,9 +205,12 @@ TSVZ warning: data.tsvz: invalid UTF-8 replaced with U+FFFD (3 occurrences, firs
203
205
  Examples: bytes after the last newline (ignored on read; truncated before the
204
206
  next append, and quoted), invalid UTF-8, a byte order mark, a newer
205
207
  `#_version_#`, a marker with a bad value, a checksum mismatch, a damaged
206
- compressed part (read up to the damage; repaired in place before the next
207
- append, with the original saved as `<part>.damaged-<time>`), an unreadable
208
- part, and a delimiter or encoding argument that conflicts with the extension.
208
+ compressed member or a zero-filled line (a member cut short by a crash keeps
209
+ the whole lines it decoded; a corrupt member or a zero-filled line is
210
+ recovered, skipped or stops the read, as the store's `#_on_corruption_#` says,
211
+ `recover` by default, spec §4.9, §4.10, §16.6; a scrub that rewrites such a
212
+ part keeps the original as `<part>.damaged-<time>`), an unreadable part, and a
213
+ delimiter or encoding argument that conflicts with the extension.
209
214
 
210
215
  ## Breaking changes from 3.39
211
216
 
@@ -235,6 +240,9 @@ part, and a delimiter or encoding argument that conflicts with the extension.
235
240
  | S9 | `clear` keeps the active markers; scrub keeps the header comment and drops other comments, custom markers and checksums. |
236
241
  | S10 | Files named `x.tsvz.<hex>` beside `x.tsvz` are read as parts of the store. |
237
242
  | S11 | `lastLineOnly` reads forward (slower on large files). |
243
+ | S12 | `TSVZedLite.clear()` and `clear_file()` raise `OSError` when the clear is refused (a part could not be read, the path names one part of a store, or the store kept changing). Memory is reloaded from the unchanged store first. |
244
+ | S13 | Compressed parts are written in members of at most 1 MiB of records (`#_member_size_#`), Zstandard frames with a checksum; an append never reads or repairs the part. |
245
+ | S14 | A zero byte in a value is written `<NUL>`, and a raw zero byte in a record is read as zero-fill damage (spec §4.9): under the default `recover` only the bytes after it are read. **A value that 4.2 or 4.3 wrote with a raw zero byte therefore reads differently in 4.4.** Such values are rare; before upgrading, `grep -c -P '\x00' store.tsvz` (any `.tsvz`, `.csvz` or `.psvz` part) finds them. Stop 4.2 and 4.3 handlers before upgrading: they read `<NUL>` as text, as they read `<CR>`. |
238
246
 
239
247
  ### The `tsvz` command
240
248
 
@@ -253,6 +261,7 @@ and `-d=,`, except the ones C5 and C9 list.
253
261
  | C8 | Usage errors print tsvz's own message, exit 2; the `-h` text is new. |
254
262
  | C9 | Arguments after STORE for `read`, `clear` and `scrub` are a usage error, exit 2 (3.39 ignored them, so `clear junk` cleared the file). |
255
263
  | C10 | The table (a terminal, or `--format table`) of `get`, `keys`, `pop`, `popitem`, `setdefault`, and of `read` on a `.tsvz`-family store, shows the rows only: no row is drawn as a header, and no row is cut to the first row's or the terminal's width. `read` of a `.tsv`-family file keeps 3.39's table, whose first row is the file's header line. |
264
+ | C11 | The table shows control characters, bidi controls and line separators as escapes (`\r`, `\n`, `\t`, `\xNN`, `\uNNNN`), so no value can move the cursor, reorder the line or restyle the terminal. It sizes columns in terminal columns, so CJK text (two columns a character) lines up. The table is for reading: a backslash in a value is shown as is, so use records for exact values. |
256
265
 
257
266
  ## Spec deviations and interpretations
258
267
 
@@ -262,7 +271,7 @@ Conformance testing).
262
271
 
263
272
  - §17.5: a numbered part opened directly is read alone, with a warning.
264
273
  - §14.5: the defaults-on-missing read applies to `t[key]` only.
265
- - §18.6: locking is the 3.39 exclusive `lockf` per write plus an in-process lock; readers do not lock.
274
+ - §18.6: locking is one exclusive whole-file lock per write plus an in-process lock; readers do not lock. On Linux it is an open file description lock, which still excludes 3.39's `lockf`; elsewhere it is `lockf`.
266
275
  - §19.4: a scrub whose rows would read differently under the final markers writes them with stripping and fill-empty off, then restores the final markers after the rows.
267
276
  - §20.7: `-q` also silences informational messages ("Created …"); only errors remain.
268
277
  - §20.2: `scrub` of a multi-part store, and `clear` of one part of one, are refused with exit 1; `read`, `get` and `parts` of a numbered part read that part alone, with a warning.
@@ -7,7 +7,7 @@ key-value store in a delimiter-separated text file**. The first column of each
7
7
  row is the key; the file behaves like an ordered dictionary that is persisted to
8
8
  disk as you change it.
9
9
 
10
- **Version 4.3**, Python **3.6+**, one self-contained module (`TSVZ.py`): drop it
10
+ **Version 4.5**, Python **3.6+**, one self-contained module (`TSVZ.py`): drop it
11
11
  next to your code and `import TSVZ`, or install it.
12
12
 
13
13
  ```bash
@@ -24,7 +24,9 @@ pip install -e . # editable, from this directory
24
24
 
25
25
  The delimiter follows the extension: tab, comma, NUL, pipe. A trailing
26
26
  compression suffix (`.gz`, `.bz2`, `.xz`, `.zst`) is allowed on both; `.zst`
27
- needs Python 3.14.
27
+ needs Python 3.14. For important or sensitive data, keep the part you write to
28
+ uncompressed and compress parts once they no longer change: a damaged
29
+ compressed member can lose every record in it (spec §16.4.2).
28
30
 
29
31
  `TSVZed`, `TSVZedLite`, `readTabularFile`, `appendTabularFile`,
30
32
  `appendLinesTabularFile`, `clearTabularFile`, `scrubTabularFile` (and the
@@ -176,9 +178,12 @@ TSVZ warning: data.tsvz: invalid UTF-8 replaced with U+FFFD (3 occurrences, firs
176
178
  Examples: bytes after the last newline (ignored on read; truncated before the
177
179
  next append, and quoted), invalid UTF-8, a byte order mark, a newer
178
180
  `#_version_#`, a marker with a bad value, a checksum mismatch, a damaged
179
- compressed part (read up to the damage; repaired in place before the next
180
- append, with the original saved as `<part>.damaged-<time>`), an unreadable
181
- part, and a delimiter or encoding argument that conflicts with the extension.
181
+ compressed member or a zero-filled line (a member cut short by a crash keeps
182
+ the whole lines it decoded; a corrupt member or a zero-filled line is
183
+ recovered, skipped or stops the read, as the store's `#_on_corruption_#` says,
184
+ `recover` by default, spec §4.9, §4.10, §16.6; a scrub that rewrites such a
185
+ part keeps the original as `<part>.damaged-<time>`), an unreadable part, and a
186
+ delimiter or encoding argument that conflicts with the extension.
182
187
 
183
188
  ## Breaking changes from 3.39
184
189
 
@@ -208,6 +213,9 @@ part, and a delimiter or encoding argument that conflicts with the extension.
208
213
  | S9 | `clear` keeps the active markers; scrub keeps the header comment and drops other comments, custom markers and checksums. |
209
214
  | S10 | Files named `x.tsvz.<hex>` beside `x.tsvz` are read as parts of the store. |
210
215
  | S11 | `lastLineOnly` reads forward (slower on large files). |
216
+ | S12 | `TSVZedLite.clear()` and `clear_file()` raise `OSError` when the clear is refused (a part could not be read, the path names one part of a store, or the store kept changing). Memory is reloaded from the unchanged store first. |
217
+ | S13 | Compressed parts are written in members of at most 1 MiB of records (`#_member_size_#`), Zstandard frames with a checksum; an append never reads or repairs the part. |
218
+ | S14 | A zero byte in a value is written `<NUL>`, and a raw zero byte in a record is read as zero-fill damage (spec §4.9): under the default `recover` only the bytes after it are read. **A value that 4.2 or 4.3 wrote with a raw zero byte therefore reads differently in 4.4.** Such values are rare; before upgrading, `grep -c -P '\x00' store.tsvz` (any `.tsvz`, `.csvz` or `.psvz` part) finds them. Stop 4.2 and 4.3 handlers before upgrading: they read `<NUL>` as text, as they read `<CR>`. |
211
219
 
212
220
  ### The `tsvz` command
213
221
 
@@ -226,6 +234,7 @@ and `-d=,`, except the ones C5 and C9 list.
226
234
  | C8 | Usage errors print tsvz's own message, exit 2; the `-h` text is new. |
227
235
  | C9 | Arguments after STORE for `read`, `clear` and `scrub` are a usage error, exit 2 (3.39 ignored them, so `clear junk` cleared the file). |
228
236
  | C10 | The table (a terminal, or `--format table`) of `get`, `keys`, `pop`, `popitem`, `setdefault`, and of `read` on a `.tsvz`-family store, shows the rows only: no row is drawn as a header, and no row is cut to the first row's or the terminal's width. `read` of a `.tsv`-family file keeps 3.39's table, whose first row is the file's header line. |
237
+ | C11 | The table shows control characters, bidi controls and line separators as escapes (`\r`, `\n`, `\t`, `\xNN`, `\uNNNN`), so no value can move the cursor, reorder the line or restyle the terminal. It sizes columns in terminal columns, so CJK text (two columns a character) lines up. The table is for reading: a backslash in a value is shown as is, so use records for exact values. |
229
238
 
230
239
  ## Spec deviations and interpretations
231
240
 
@@ -235,7 +244,7 @@ Conformance testing).
235
244
 
236
245
  - §17.5: a numbered part opened directly is read alone, with a warning.
237
246
  - §14.5: the defaults-on-missing read applies to `t[key]` only.
238
- - §18.6: locking is the 3.39 exclusive `lockf` per write plus an in-process lock; readers do not lock.
247
+ - §18.6: locking is one exclusive whole-file lock per write plus an in-process lock; readers do not lock. On Linux it is an open file description lock, which still excludes 3.39's `lockf`; elsewhere it is `lockf`.
239
248
  - §19.4: a scrub whose rows would read differently under the final markers writes them with stripping and fill-empty off, then restores the final markers after the rows.
240
249
  - §20.7: `-q` also silences informational messages ("Created …"); only errors remain.
241
250
  - §20.2: `scrub` of a multi-part store, and `clear` of one part of one, are refused with exit 1; `read`, `get` and `parts` of a numbered part read that part alone, with a warning.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TSVZ
3
- Version: 4.3
3
+ Version: 4.5
4
4
  Summary: Key-value store kept in a TSV / CSV / NSV / PSV file, with tsvz-spec-v1 support
5
5
  Home-page: https://github.com/yufei-pan/TSVZ
6
6
  Author: Yufei Pan
@@ -34,7 +34,7 @@ key-value store in a delimiter-separated text file**. The first column of each
34
34
  row is the key; the file behaves like an ordered dictionary that is persisted to
35
35
  disk as you change it.
36
36
 
37
- **Version 4.3**, Python **3.6+**, one self-contained module (`TSVZ.py`): drop it
37
+ **Version 4.5**, Python **3.6+**, one self-contained module (`TSVZ.py`): drop it
38
38
  next to your code and `import TSVZ`, or install it.
39
39
 
40
40
  ```bash
@@ -51,7 +51,9 @@ pip install -e . # editable, from this directory
51
51
 
52
52
  The delimiter follows the extension: tab, comma, NUL, pipe. A trailing
53
53
  compression suffix (`.gz`, `.bz2`, `.xz`, `.zst`) is allowed on both; `.zst`
54
- needs Python 3.14.
54
+ needs Python 3.14. For important or sensitive data, keep the part you write to
55
+ uncompressed and compress parts once they no longer change: a damaged
56
+ compressed member can lose every record in it (spec §16.4.2).
55
57
 
56
58
  `TSVZed`, `TSVZedLite`, `readTabularFile`, `appendTabularFile`,
57
59
  `appendLinesTabularFile`, `clearTabularFile`, `scrubTabularFile` (and the
@@ -203,9 +205,12 @@ TSVZ warning: data.tsvz: invalid UTF-8 replaced with U+FFFD (3 occurrences, firs
203
205
  Examples: bytes after the last newline (ignored on read; truncated before the
204
206
  next append, and quoted), invalid UTF-8, a byte order mark, a newer
205
207
  `#_version_#`, a marker with a bad value, a checksum mismatch, a damaged
206
- compressed part (read up to the damage; repaired in place before the next
207
- append, with the original saved as `<part>.damaged-<time>`), an unreadable
208
- part, and a delimiter or encoding argument that conflicts with the extension.
208
+ compressed member or a zero-filled line (a member cut short by a crash keeps
209
+ the whole lines it decoded; a corrupt member or a zero-filled line is
210
+ recovered, skipped or stops the read, as the store's `#_on_corruption_#` says,
211
+ `recover` by default, spec §4.9, §4.10, §16.6; a scrub that rewrites such a
212
+ part keeps the original as `<part>.damaged-<time>`), an unreadable part, and a
213
+ delimiter or encoding argument that conflicts with the extension.
209
214
 
210
215
  ## Breaking changes from 3.39
211
216
 
@@ -235,6 +240,9 @@ part, and a delimiter or encoding argument that conflicts with the extension.
235
240
  | S9 | `clear` keeps the active markers; scrub keeps the header comment and drops other comments, custom markers and checksums. |
236
241
  | S10 | Files named `x.tsvz.<hex>` beside `x.tsvz` are read as parts of the store. |
237
242
  | S11 | `lastLineOnly` reads forward (slower on large files). |
243
+ | S12 | `TSVZedLite.clear()` and `clear_file()` raise `OSError` when the clear is refused (a part could not be read, the path names one part of a store, or the store kept changing). Memory is reloaded from the unchanged store first. |
244
+ | S13 | Compressed parts are written in members of at most 1 MiB of records (`#_member_size_#`), Zstandard frames with a checksum; an append never reads or repairs the part. |
245
+ | S14 | A zero byte in a value is written `<NUL>`, and a raw zero byte in a record is read as zero-fill damage (spec §4.9): under the default `recover` only the bytes after it are read. **A value that 4.2 or 4.3 wrote with a raw zero byte therefore reads differently in 4.4.** Such values are rare; before upgrading, `grep -c -P '\x00' store.tsvz` (any `.tsvz`, `.csvz` or `.psvz` part) finds them. Stop 4.2 and 4.3 handlers before upgrading: they read `<NUL>` as text, as they read `<CR>`. |
238
246
 
239
247
  ### The `tsvz` command
240
248
 
@@ -253,6 +261,7 @@ and `-d=,`, except the ones C5 and C9 list.
253
261
  | C8 | Usage errors print tsvz's own message, exit 2; the `-h` text is new. |
254
262
  | C9 | Arguments after STORE for `read`, `clear` and `scrub` are a usage error, exit 2 (3.39 ignored them, so `clear junk` cleared the file). |
255
263
  | C10 | The table (a terminal, or `--format table`) of `get`, `keys`, `pop`, `popitem`, `setdefault`, and of `read` on a `.tsvz`-family store, shows the rows only: no row is drawn as a header, and no row is cut to the first row's or the terminal's width. `read` of a `.tsv`-family file keeps 3.39's table, whose first row is the file's header line. |
264
+ | C11 | The table shows control characters, bidi controls and line separators as escapes (`\r`, `\n`, `\t`, `\xNN`, `\uNNNN`), so no value can move the cursor, reorder the line or restyle the terminal. It sizes columns in terminal columns, so CJK text (two columns a character) lines up. The table is for reading: a backslash in a value is shown as is, so use records for exact values. |
256
265
 
257
266
  ## Spec deviations and interpretations
258
267
 
@@ -262,7 +271,7 @@ Conformance testing).
262
271
 
263
272
  - §17.5: a numbered part opened directly is read alone, with a warning.
264
273
  - §14.5: the defaults-on-missing read applies to `t[key]` only.
265
- - §18.6: locking is the 3.39 exclusive `lockf` per write plus an in-process lock; readers do not lock.
274
+ - §18.6: locking is one exclusive whole-file lock per write plus an in-process lock; readers do not lock. On Linux it is an open file description lock, which still excludes 3.39's `lockf`; elsewhere it is `lockf`.
266
275
  - §19.4: a scrub whose rows would read differently under the final markers writes them with stripping and fill-empty off, then restores the final markers after the rows.
267
276
  - §20.7: `-q` also silences informational messages ("Created …"); only errors remain.
268
277
  - §20.2: `scrub` of a multi-part store, and `clear` of one part of one, are refused with exit 1; `read`, `get` and `parts` of a numbered part read that part alone, with a warning.