hypertabular 0.9.0 → 1.1.0
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.
- checksums.yaml +4 -4
- data/LICENSE-UNICODE +39 -0
- data/README.md +325 -37
- data/lib/hypertabular/batch.rb +219 -24
- data/lib/hypertabular/column.rb +172 -24
- data/lib/hypertabular/delimited_reader.rb +337 -94
- data/lib/hypertabular/dialect.rb +92 -10
- data/lib/hypertabular/guarded.rb +116 -0
- data/lib/hypertabular/header.rb +59 -22
- data/lib/hypertabular/native/linux-arm64/libhypertabular.so +0 -0
- data/lib/hypertabular/native/linux-musl-arm64/libhypertabular.so +0 -0
- data/lib/hypertabular/native/linux-musl-x64/libhypertabular.so +0 -0
- data/lib/hypertabular/native/linux-x64/libhypertabular.so +0 -0
- data/lib/hypertabular/native/osx-arm64/libhypertabular.dylib +0 -0
- data/lib/hypertabular/native/osx-x64/libhypertabular.dylib +0 -0
- data/lib/hypertabular/native/win-arm64/hypertabular.dll +0 -0
- data/lib/hypertabular/native/win-x64/hypertabular.dll +0 -0
- data/lib/hypertabular/row.rb +17 -4
- data/lib/hypertabular/runtime/columns.rb +78 -12
- data/lib/hypertabular/runtime/delimited.rb +80 -38
- data/lib/hypertabular/runtime/workbook.rb +41 -17
- data/lib/hypertabular/runtime.rb +255 -17
- data/lib/hypertabular/suggest.rb +283 -0
- data/lib/hypertabular/tabular_error.rb +17 -5
- data/lib/hypertabular/workbook.rb +187 -47
- data/lib/hypertabular.rb +15 -9
- metadata +8 -4
data/lib/hypertabular.rb
CHANGED
|
@@ -6,7 +6,7 @@ require_relative "hypertabular/runtime/delimited"
|
|
|
6
6
|
require_relative "hypertabular/runtime/workbook"
|
|
7
7
|
|
|
8
8
|
# Tabular parsing with a HyperCast verdict for every cell: delimited text — CSV, TSV, any
|
|
9
|
-
# single-byte ASCII separator — and workbooks — XLSX and
|
|
9
|
+
# single-byte ASCII separator — and workbooks — XLSX, ODS and Numbers — read a batch at a time into
|
|
10
10
|
# typed columns by one Rust core (libhypertabular), called through Fiddle.
|
|
11
11
|
#
|
|
12
12
|
# plan = [HyperTabular::Column.i32(0), HyperTabular::Column.text(1)]
|
|
@@ -28,17 +28,20 @@ require_relative "hypertabular/runtime/workbook"
|
|
|
28
28
|
# reader.bind([HyperTabular::Column.text(reader.header.ordinal("name"))])
|
|
29
29
|
# reader.map { |row| row.value(0) } # => ["alice"]
|
|
30
30
|
#
|
|
31
|
-
# Nothing is sniffed: the Dialect states the separator, the quoting
|
|
32
|
-
#
|
|
33
|
-
#
|
|
31
|
+
# Nothing is sniffed: the Dialect states the separator, the quoting, the header, what to pass
|
|
32
|
+
# over, what a record of the wrong width is, the encoding and what stands for no value;
|
|
33
|
+
# SheetOptions a sheet's header, what to pass over, its range and whether empty rows are skipped;
|
|
34
|
+
# and the plan states each Column's door and, for numbers, its notation. A Suggestion offers a
|
|
35
|
+
# plan to inspect, from a sample, and applies nothing. HyperCast is the judge:
|
|
34
36
|
# the verdicts (HyperCast::Success, HyperCast::Fault), the notation (HyperCast::NumFormat),
|
|
35
37
|
# the exact decimal (HyperCast::Decimal) and the declared options are that gem's own types,
|
|
36
38
|
# and a cell means exactly what HyperCast's door would say of the same text. A bad value is
|
|
37
|
-
# a verdict
|
|
39
|
+
# a verdict, with its detail and Batch#origin beside it, and Batch#faults lists a batch's; a broken
|
|
40
|
+
# file is a TabularError.
|
|
38
41
|
module HyperTabular
|
|
39
42
|
# This gem's own version — kept in lockstep with hypertabular.gemspec and the core's
|
|
40
43
|
# rust/Cargo.toml.
|
|
41
|
-
VERSION = "
|
|
44
|
+
VERSION = "1.1.0"
|
|
42
45
|
|
|
43
46
|
class << self
|
|
44
47
|
# Whether the native core loaded and exports the ABI this binding was built against.
|
|
@@ -71,13 +74,16 @@ require_relative "hypertabular/tabular_error"
|
|
|
71
74
|
require_relative "hypertabular/header"
|
|
72
75
|
require_relative "hypertabular/row"
|
|
73
76
|
require_relative "hypertabular/batch"
|
|
77
|
+
require_relative "hypertabular/suggest"
|
|
78
|
+
require_relative "hypertabular/guarded"
|
|
74
79
|
require_relative "hypertabular/delimited_reader"
|
|
75
80
|
require_relative "hypertabular/workbook"
|
|
76
81
|
|
|
77
82
|
# --- backend selection, as hypercast makes its own: the Magnus extension, when present,
|
|
78
|
-
#
|
|
79
|
-
#
|
|
80
|
-
# Runtime.unescape), so that is all the extension
|
|
83
|
+
# takes over the Fiddle crossing. Every native call and every byte of native memory is behind
|
|
84
|
+
# HyperTabular::Runtime (Runtime::Delimited, Runtime::Book::Opened and ::Reading, and
|
|
85
|
+
# Runtime.unescape), so that is all the extension defines in front of it, never over it
|
|
86
|
+
# (rust/src/ruby_ext.rs; the FiddleBackend modules say why): the
|
|
81
87
|
# constructors hand back objects of its own that answer the same methods with the same bytes,
|
|
82
88
|
# and everything above them — the readers, the workbook, Batch and every value and verdict it
|
|
83
89
|
# builds — is the same Ruby on either backend. It is how the precompiled platform gems ship,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hypertabular
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian Buvinghausen
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: '1.1'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: '1.1'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: fiddle
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +66,7 @@ dependencies:
|
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: '0.9'
|
|
68
68
|
description: |
|
|
69
|
-
CSV, TSV and any single-byte ASCII separator, and XLSX and
|
|
69
|
+
CSV, TSV and any single-byte ASCII separator, and XLSX, ODS and Numbers workbooks, read by a
|
|
70
70
|
native Rust core into typed column batches. The core owns no memory: this gem allocates the buffers once and the
|
|
71
71
|
core fills them in one native call per batch. Every cell is a HyperCast verdict — the
|
|
72
72
|
value, or a reason plus the offending span — and a file that is not rows of cells at
|
|
@@ -78,12 +78,14 @@ extensions: []
|
|
|
78
78
|
extra_rdoc_files: []
|
|
79
79
|
files:
|
|
80
80
|
- LICENSE
|
|
81
|
+
- LICENSE-UNICODE
|
|
81
82
|
- README.md
|
|
82
83
|
- lib/hypertabular.rb
|
|
83
84
|
- lib/hypertabular/batch.rb
|
|
84
85
|
- lib/hypertabular/column.rb
|
|
85
86
|
- lib/hypertabular/delimited_reader.rb
|
|
86
87
|
- lib/hypertabular/dialect.rb
|
|
88
|
+
- lib/hypertabular/guarded.rb
|
|
87
89
|
- lib/hypertabular/header.rb
|
|
88
90
|
- lib/hypertabular/native/linux-arm64/libhypertabular.so
|
|
89
91
|
- lib/hypertabular/native/linux-musl-arm64/libhypertabular.so
|
|
@@ -98,11 +100,13 @@ files:
|
|
|
98
100
|
- lib/hypertabular/runtime/columns.rb
|
|
99
101
|
- lib/hypertabular/runtime/delimited.rb
|
|
100
102
|
- lib/hypertabular/runtime/workbook.rb
|
|
103
|
+
- lib/hypertabular/suggest.rb
|
|
101
104
|
- lib/hypertabular/tabular_error.rb
|
|
102
105
|
- lib/hypertabular/workbook.rb
|
|
103
106
|
homepage: https://github.com/SkunkWerkx/HyperTabular
|
|
104
107
|
licenses:
|
|
105
108
|
- MIT
|
|
109
|
+
- Unicode-3.0
|
|
106
110
|
metadata:
|
|
107
111
|
source_code_uri: https://github.com/SkunkWerkx/HyperTabular
|
|
108
112
|
bug_tracker_uri: https://github.com/SkunkWerkx/HyperTabular/issues
|