csv-utils 0.3.25 → 0.6.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.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.25
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: csv
@@ -15,29 +15,39 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: '3.0'
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: '0'
25
+ version: '3.0'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: inheritance-helper
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '0'
32
+ version: '0.2'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '2'
33
36
  type: :runtime
34
37
  prerelease: false
35
38
  version_requirements: !ruby/object:Gem::Requirement
36
39
  requirements:
37
40
  - - ">="
38
41
  - !ruby/object:Gem::Version
39
- version: '0'
40
- description: Tools for debugging malformed CSV files
42
+ version: '0.2'
43
+ - - "<"
44
+ - !ruby/object:Gem::Version
45
+ version: '2'
46
+ description: Streaming tools for CSV files too big or too broken to load into memory.
47
+ Compare two sorted files into create, update and delete actions, sort with an external
48
+ merge sort, transform and extend rows in batches, and build reports from Ruby objects.
49
+ Detects separators, byte order marks and encodings, and ships command line tools
50
+ that pinpoint malformed rows, diff, grep, split and validate CSV files.
41
51
  email: dougyouch@gmail.com
42
52
  executables:
43
53
  - csv-change-eol
@@ -52,11 +62,7 @@ executables:
52
62
  extensions: []
53
63
  extra_rdoc_files: []
54
64
  files:
55
- - ".gitignore"
56
- - ".ruby-gemset"
57
- - ".ruby-version"
58
- - Gemfile
59
- - Gemfile.lock
65
+ - CHANGELOG.md
60
66
  - LICENSE
61
67
  - README.md
62
68
  - bin/csv-change-eol
@@ -68,23 +74,28 @@ files:
68
74
  - bin/csv-readline
69
75
  - bin/csv-splitter
70
76
  - bin/csv-validator
71
- - csv-utils.gemspec
72
- - docs/ARCHITECTURE.md
73
77
  - lib/csv-utils.rb
78
+ - lib/csv_utils/byte_order_mark.rb
74
79
  - lib/csv_utils/csv_compare.rb
75
80
  - lib/csv_utils/csv_extender.rb
76
81
  - lib/csv_utils/csv_iterator.rb
77
82
  - lib/csv_utils/csv_options.rb
78
83
  - lib/csv_utils/csv_report.rb
79
84
  - lib/csv_utils/csv_row.rb
85
+ - lib/csv_utils/csv_row_matcher.rb
80
86
  - lib/csv_utils/csv_sort.rb
81
87
  - lib/csv_utils/csv_transformer.rb
82
88
  - lib/csv_utils/csv_wrapper.rb
83
- - script/console
89
+ - lib/csv_utils/version.rb
84
90
  homepage: https://github.com/dougyouch/csv-utils
85
91
  licenses:
86
92
  - MIT
87
- metadata: {}
93
+ metadata:
94
+ rubygems_mfa_required: 'true'
95
+ source_code_uri: https://github.com/dougyouch/csv-utils
96
+ changelog_uri: https://github.com/dougyouch/csv-utils/blob/master/CHANGELOG.md
97
+ bug_tracker_uri: https://github.com/dougyouch/csv-utils/issues
98
+ documentation_uri: https://rubydoc.info/gems/csv-utils
88
99
  rdoc_options: []
89
100
  require_paths:
90
101
  - lib
@@ -92,14 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
103
  requirements:
93
104
  - - ">="
94
105
  - !ruby/object:Gem::Version
95
- version: '0'
106
+ version: '3.3'
96
107
  required_rubygems_version: !ruby/object:Gem::Requirement
97
108
  requirements:
98
109
  - - ">="
99
110
  - !ruby/object:Gem::Version
100
111
  version: '0'
101
112
  requirements: []
102
- rubygems_version: 3.6.2
113
+ rubygems_version: 4.0.20
103
114
  specification_version: 4
104
- summary: CSV Utils
115
+ summary: Compare, sort, transform and debug large or malformed CSV files
105
116
  test_files: []
data/.gitignore DELETED
@@ -1,52 +0,0 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
- /tmp/
12
-
13
- # Used by dotenv library to load environment variables.
14
- # .env
15
-
16
- ## Specific to RubyMotion:
17
- .dat*
18
- .repl_history
19
- build/
20
- *.bridgesupport
21
- build-iPhoneOS/
22
- build-iPhoneSimulator/
23
-
24
- ## Specific to RubyMotion (use of CocoaPods):
25
- #
26
- # We recommend against adding the Pods directory to your .gitignore. However
27
- # you should judge for yourself, the pros and cons are mentioned at:
28
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
- #
30
- # vendor/Pods/
31
-
32
- ## Documentation cache and generated files:
33
- /.yardoc/
34
- /_yardoc/
35
- /doc/
36
- /rdoc/
37
-
38
- ## Environment normalization:
39
- /.bundle/
40
- /vendor/bundle
41
- /lib/bundler/man/
42
-
43
- # for a library or gem, you might want to ignore these files since the code is
44
- # intended to run in multiple environments; otherwise, check them in:
45
- # Gemfile.lock
46
- # .ruby-version
47
- # .ruby-gemset
48
-
49
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
- .rvmrc
51
-
52
- *~
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- csv-utils
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.4.2
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'http://rubygems.org'
4
-
5
- gem 'csv'
6
- gem 'inheritance-helper'
7
-
8
- group :development do
9
- gem 'rake'
10
- gem 'rubocop'
11
- gem 'rspec'
12
- gem 'simplecov'
13
- end
data/Gemfile.lock DELETED
@@ -1,72 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- ast (2.4.3)
5
- csv (3.3.4)
6
- diff-lcs (1.6.2)
7
- docile (1.4.1)
8
- inheritance-helper (0.2.5)
9
- json (2.12.0)
10
- language_server-protocol (3.17.0.5)
11
- lint_roller (1.1.0)
12
- parallel (1.27.0)
13
- parser (3.3.8.0)
14
- ast (~> 2.4.1)
15
- racc
16
- prism (1.4.0)
17
- racc (1.8.1)
18
- rainbow (3.1.1)
19
- rake (13.2.1)
20
- regexp_parser (2.10.0)
21
- rspec (3.13.0)
22
- rspec-core (~> 3.13.0)
23
- rspec-expectations (~> 3.13.0)
24
- rspec-mocks (~> 3.13.0)
25
- rspec-core (3.13.3)
26
- rspec-support (~> 3.13.0)
27
- rspec-expectations (3.13.4)
28
- diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.13.0)
30
- rspec-mocks (3.13.4)
31
- diff-lcs (>= 1.2.0, < 2.0)
32
- rspec-support (~> 3.13.0)
33
- rspec-support (3.13.3)
34
- rubocop (1.75.6)
35
- json (~> 2.3)
36
- language_server-protocol (~> 3.17.0.2)
37
- lint_roller (~> 1.1.0)
38
- parallel (~> 1.10)
39
- parser (>= 3.3.0.2)
40
- rainbow (>= 2.2.2, < 4.0)
41
- regexp_parser (>= 2.9.3, < 3.0)
42
- rubocop-ast (>= 1.44.0, < 2.0)
43
- ruby-progressbar (~> 1.7)
44
- unicode-display_width (>= 2.4.0, < 4.0)
45
- rubocop-ast (1.44.1)
46
- parser (>= 3.3.7.2)
47
- prism (~> 1.4)
48
- ruby-progressbar (1.13.0)
49
- simplecov (0.22.0)
50
- docile (~> 1.1)
51
- simplecov-html (~> 0.11)
52
- simplecov_json_formatter (~> 0.1)
53
- simplecov-html (0.13.1)
54
- simplecov_json_formatter (0.1.4)
55
- unicode-display_width (3.1.4)
56
- unicode-emoji (~> 4.0, >= 4.0.4)
57
- unicode-emoji (4.0.4)
58
-
59
- PLATFORMS
60
- ruby
61
- x86_64-darwin-24
62
-
63
- DEPENDENCIES
64
- csv
65
- inheritance-helper
66
- rake
67
- rspec
68
- rubocop
69
- simplecov
70
-
71
- BUNDLED WITH
72
- 2.6.2
data/csv-utils.gemspec DELETED
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Gem::Specification.new do |s|
4
- s.name = 'csv-utils'
5
- s.version = '0.3.25'
6
- s.licenses = ['MIT']
7
- s.summary = 'CSV Utils'
8
- s.description = 'Tools for debugging malformed CSV files'
9
- s.authors = ['Doug Youch']
10
- s.email = 'dougyouch@gmail.com'
11
- s.homepage = 'https://github.com/dougyouch/csv-utils'
12
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
13
- s.bindir = 'bin'
14
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
-
16
- s.add_runtime_dependency 'csv'
17
- s.add_runtime_dependency 'inheritance-helper'
18
- end
data/docs/ARCHITECTURE.md DELETED
@@ -1,134 +0,0 @@
1
- # CSV Utils Architecture
2
-
3
- ## Overview
4
-
5
- CSV Utils is a Ruby library designed to provide a comprehensive set of tools for CSV file manipulation. The architecture follows a modular design pattern, with each component handling a specific aspect of CSV processing.
6
-
7
- ## Core Components
8
-
9
- ### 1. CSVCompare
10
- - **Purpose**: Compares two CSV files to identify differences
11
- - **Key Features**:
12
- - Identifies creates, updates, and deletes between files
13
- - Supports custom comparison logic
14
- - Handles BOM (Byte Order Mark) stripping
15
- - Memory-efficient streaming comparison
16
- - **Dependencies**: None (uses standard Ruby CSV library)
17
-
18
- ### 2. CSVTransformer
19
- - **Purpose**: Transforms CSV data according to custom rules
20
- - **Key Features**:
21
- - Row-by-row transformation
22
- - Custom transformation blocks
23
- - Maintains header structure
24
- - **Dependencies**: None
25
-
26
- ### 3. CSVSort
27
- - **Purpose**: Sorts CSV files based on specified columns
28
- - **Key Features**:
29
- - Multi-column sorting
30
- - Memory-efficient sorting
31
- - Preserves header row
32
- - **Dependencies**: None
33
-
34
- ### 4. CSVReport
35
- - **Purpose**: Generates reports from CSV data
36
- - **Key Features**:
37
- - Custom report formatting
38
- - Data aggregation
39
- - Summary statistics
40
- - **Dependencies**: None
41
-
42
- ### 5. CSVIterator
43
- - **Purpose**: Provides efficient iteration over CSV files
44
- - **Key Features**:
45
- - Memory-efficient streaming
46
- - Custom iteration blocks
47
- - Header handling
48
- - **Dependencies**: None
49
-
50
- ### 6. CSVExtender
51
- - **Purpose**: Extends CSV files with additional data
52
- - **Key Features**:
53
- - Column addition
54
- - Data enrichment
55
- - Custom extension logic
56
- - **Dependencies**: None
57
-
58
- ### 7. CSVWrapper
59
- - **Purpose**: Provides a convenient wrapper for CSV operations
60
- - **Key Features**:
61
- - Simplified CSV access
62
- - Common operation shortcuts
63
- - Error handling
64
- - **Dependencies**: None
65
-
66
- ## Design Principles
67
-
68
- 1. **Modularity**: Each component is self-contained and focused on a single responsibility
69
- 2. **Memory Efficiency**: Components are designed to handle large files through streaming
70
- 3. **Extensibility**: Custom logic can be injected through blocks and callbacks
71
- 4. **Error Handling**: Robust error handling and validation
72
- 5. **Performance**: Optimized for large file processing
73
-
74
- ## Data Flow
75
-
76
- 1. **Input Processing**:
77
- - Files are read using Ruby's CSV library
78
- - BOM stripping is handled automatically
79
- - Headers are preserved and validated
80
-
81
- 2. **Processing**:
82
- - Each component processes data in a streaming fashion
83
- - Custom logic can be injected at various points
84
- - Memory usage is optimized for large files
85
-
86
- 3. **Output Generation**:
87
- - Results are written to new files or returned as data structures
88
- - Headers are preserved in output files
89
- - Error states are properly handled
90
-
91
- ## Error Handling
92
-
93
- - File not found errors
94
- - Invalid CSV format
95
- - Missing required columns
96
- - Permission issues
97
- - Memory constraints
98
-
99
- ## Performance Considerations
100
-
101
- 1. **Memory Usage**:
102
- - Streaming processing for large files
103
- - Minimal in-memory data storage
104
- - Efficient data structures
105
-
106
- 2. **Processing Speed**:
107
- - Optimized comparison algorithms
108
- - Efficient sorting mechanisms
109
- - Minimal file I/O operations
110
-
111
- ## Future Considerations
112
-
113
- 1. **Potential Enhancements**:
114
- - Parallel processing support
115
- - Additional data format support
116
- - Enhanced reporting capabilities
117
- - Caching mechanisms
118
-
119
- 2. **Scalability**:
120
- - Support for distributed processing
121
- - Cloud storage integration
122
- - Batch processing capabilities
123
-
124
- ## Testing Strategy
125
-
126
- 1. **Unit Tests**:
127
- - Individual component testing
128
- - Edge case coverage
129
- - Performance benchmarks
130
-
131
- 2. **Integration Tests**:
132
- - Component interaction testing
133
- - End-to-end workflows
134
- - Error scenario coverage
data/script/console DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- $LOAD_PATH << File.expand_path('../lib', __dir__)
5
- require 'csv-utils'
6
- require 'irb'
7
- IRB.start(__FILE__)