csvsmith 0.7.0__tar.gz → 0.7.2__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 (38) hide show
  1. csvsmith-0.7.2/PKG-INFO +266 -0
  2. csvsmith-0.7.2/README.rst +223 -0
  3. {csvsmith-0.7.0 → csvsmith-0.7.2}/pyproject.toml +2 -1
  4. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/__init__.py +9 -7
  5. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/cli.py +1 -1
  6. csvsmith-0.7.2/src/csvsmith.egg-info/PKG-INFO +266 -0
  7. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith.egg-info/SOURCES.txt +1 -1
  8. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_clean_numeric.py +1 -1
  9. csvsmith-0.7.0/PKG-INFO +0 -463
  10. csvsmith-0.7.0/README.rst +0 -421
  11. csvsmith-0.7.0/src/csvsmith.egg-info/PKG-INFO +0 -463
  12. {csvsmith-0.7.0 → csvsmith-0.7.2}/LICENSE +0 -0
  13. {csvsmith-0.7.0 → csvsmith-0.7.2}/setup.cfg +0 -0
  14. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/__init__.py +0 -0
  15. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/classify.py +0 -0
  16. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/excel2csv.py +0 -0
  17. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/filter_rows.py +0 -0
  18. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/find_matches_in_csv.py +0 -0
  19. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/move_files.py +0 -0
  20. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/tools/row_dedup.py +0 -0
  21. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/utils/__init__.py +0 -0
  22. {csvsmith-0.7.0/src/csvsmith/tools → csvsmith-0.7.2/src/csvsmith/utils}/clean_numeric.py +0 -0
  23. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/utils/distance.py +0 -0
  24. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/utils/io.py +0 -0
  25. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith/utils/normalize.py +0 -0
  26. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith.egg-info/dependency_links.txt +0 -0
  27. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith.egg-info/entry_points.txt +0 -0
  28. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith.egg-info/requires.txt +0 -0
  29. {csvsmith-0.7.0 → csvsmith-0.7.2}/src/csvsmith.egg-info/top_level.txt +0 -0
  30. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_classify.py +0 -0
  31. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_cli.py +0 -0
  32. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_excel2csv.py +0 -0
  33. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_filter_rows.py +0 -0
  34. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_find_matches_in_csv.py +0 -0
  35. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_move_files.py +0 -0
  36. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_normalize.py +0 -0
  37. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_row_dedup.py +0 -0
  38. {csvsmith-0.7.0 → csvsmith-0.7.2}/tests/test_string_distance.py +0 -0
@@ -0,0 +1,266 @@
1
+ Metadata-Version: 2.4
2
+ Name: csvsmith
3
+ Version: 0.7.2
4
+ Summary: Small CSV utilities: row deduplication, classification, row filtering, and CLI helpers.
5
+ Author-email: Eiichi YAMAMOTO <info@yeiichi.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Eiichi YAMAMOTO
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26
+ IN THE SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/yeiichi/csvsmith
29
+ Project-URL: Repository, https://github.com/yeiichi/csvsmith
30
+ Project-URL: Documentation, https://csvsmith.readthedocs.io/en/latest/
31
+ Keywords: csv,deduplication,data-filtering,file-organization,filtering
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3 :: Only
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: Topic :: Software Development :: Libraries
37
+ Classifier: Topic :: Utilities
38
+ Requires-Python: >=3.10
39
+ Description-Content-Type: text/x-rst
40
+ License-File: LICENSE
41
+ Requires-Dist: openpyxl>=3.1
42
+ Dynamic: license-file
43
+
44
+ csvsmith
45
+ ========
46
+
47
+ .. image:: https://img.shields.io/pypi/v/csvsmith.svg
48
+ :target: https://pypi.org/project/csvsmith/
49
+ :alt: PyPI version
50
+
51
+ .. image:: https://img.shields.io/pypi/pyversions/csvsmith.svg
52
+ :target: https://pypi.org/project/csvsmith/
53
+ :alt: Supported Python versions
54
+
55
+ .. image:: https://img.shields.io/pypi/l/csvsmith.svg
56
+ :target: https://opensource.org/licenses/
57
+ :alt: License
58
+
59
+ .. image:: https://img.shields.io/badge/docs-Read%20the%20Docs-blue.svg
60
+ :target: https://csvsmith.readthedocs.io/en/latest/
61
+ :alt: Documentation
62
+
63
+ Small, focused CSV utilities for common data wrangling tasks.
64
+
65
+ ``csvsmith`` provides a handful of practical tools for working with CSV
66
+ files, including cleaning numeric values, filtering rows, deduplicating
67
+ records, classifying files, converting Excel spreadsheets to CSV, moving
68
+ files by suffix, and finding matches inside CSV content.
69
+
70
+ Documentation
71
+ -------------
72
+
73
+ Read the full documentation at:
74
+
75
+ https://csvsmith.readthedocs.io/en/latest/
76
+
77
+ Features
78
+ --------
79
+
80
+ - Clean numeric strings into normalized values
81
+ - Filter CSV rows by substring matching
82
+ - Deduplicate row data and generate reports
83
+ - Classify CSV files into folders based on headers/signatures
84
+ - Convert Excel workbooks to CSV
85
+ - Move files by suffix
86
+ - Find matching values inside CSV files
87
+ - Use the tools either from Python or from the command line
88
+
89
+ Installation
90
+ ------------
91
+
92
+ Install the package in your environment as usual for your project setup.
93
+
94
+ Example:
95
+
96
+ .. code-block:: console
97
+
98
+ pip install csvsmith
99
+
100
+ If you are developing locally, install it in editable mode from the project
101
+ root:
102
+
103
+ .. code-block:: console
104
+
105
+ pip install -e .
106
+
107
+ Quick start
108
+ -----------
109
+
110
+ You can use the library from Python:
111
+
112
+ .. code-block:: python
113
+
114
+ from csvsmith import (
115
+ clean_numeric,
116
+ dedupe_with_report,
117
+ excel_to_csv,
118
+ find_matches_in_csv,
119
+ move_by_suffix,
120
+ )
121
+
122
+ print(clean_numeric("1,234.56"))
123
+
124
+ Or use the command-line interface:
125
+
126
+ .. code-block:: console
127
+
128
+ csvsmith --help
129
+
130
+ Command-line usage
131
+ ------------------
132
+
133
+ The package provides a CLI with several subcommands.
134
+
135
+ Clean numeric values:
136
+
137
+ .. code-block:: console
138
+
139
+ csvsmith clean-numeric "1,234.56" --sep "," --decimal "."
140
+
141
+ Filter rows in a CSV:
142
+
143
+ .. code-block:: console
144
+
145
+ csvsmith drop-rows input.csv notes spam --case-insensitive --drop-header
146
+
147
+ Deduplicate rows:
148
+
149
+ .. code-block:: console
150
+
151
+ csvsmith dedupe input.csv -o out.csv --subset id --keep first
152
+
153
+ Classify CSV files:
154
+
155
+ .. code-block:: console
156
+
157
+ csvsmith classify src_dir dst_dir --mode relaxed --match subset --auto --dry-run
158
+
159
+ Convert Excel to CSV:
160
+
161
+ .. code-block:: console
162
+
163
+ csvsmith excel2csv input.xlsx
164
+
165
+ Move files by suffix:
166
+
167
+ .. code-block:: console
168
+
169
+ csvsmith move-files src_dir dst_dir --suffixes .csv,.pdf
170
+
171
+ Find matches in a CSV:
172
+
173
+ .. code-block:: console
174
+
175
+ csvsmith find-matches input.csv target --ignore-case --ignore-whitespace
176
+
177
+ Find matches in a CSV
178
+ ---------------------
179
+
180
+ ``find_matches_in_csv`` searches a CSV file for a target value and returns
181
+ match records containing coordinates and row context information.
182
+
183
+ Python API:
184
+
185
+ .. code-block:: python
186
+
187
+ from csvsmith import find_matches_in_csv
188
+
189
+ results = find_matches_in_csv("input.csv", "target")
190
+
191
+ CLI:
192
+
193
+ .. code-block:: console
194
+
195
+ csvsmith find-matches input.csv target
196
+
197
+ Options:
198
+
199
+ - ``--ignore-case``: ignore case while matching
200
+ - ``--ignore-whitespace``: ignore whitespace while matching
201
+ - ``--no-nfkc``: disable NFKC normalization
202
+
203
+ If matches are found, the CLI prints formatted JSON. If no matches are found,
204
+ it prints a simple message.
205
+
206
+ Other Python APIs
207
+ -----------------
208
+
209
+ The package also exposes a few other helper functions and classes from its
210
+ top-level API.
211
+
212
+ Numeric and row tools:
213
+
214
+ .. code-block:: python
215
+
216
+ from csvsmith import (
217
+ clean_numeric,
218
+ count_duplicates_sorted,
219
+ add_row_digest,
220
+ find_duplicate_rows,
221
+ dedupe_with_report,
222
+ read_csv_rows,
223
+ write_csv_rows,
224
+ )
225
+
226
+ CSV classification and filtering:
227
+
228
+ .. code-block:: python
229
+
230
+ from csvsmith import CSVClassifier, DropRowsBySubstring, CSVCleaner
231
+
232
+ File and conversion helpers:
233
+
234
+ .. code-block:: python
235
+
236
+ from csvsmith import excel_to_csv, move_by_suffix
237
+
238
+ String comparison utilities:
239
+
240
+ .. code-block:: python
241
+
242
+ from csvsmith import StringDistance, Relation, Result, analyze_pair
243
+
244
+ Project structure
245
+ -----------------
246
+
247
+ The code is organized into two main areas:
248
+
249
+ - ``csvsmith.tools`` for higher-level CSV workflows
250
+ - ``csvsmith.utils`` for reusable utility helpers
251
+
252
+ Testing
253
+ -------
254
+
255
+ Run the test suite with your preferred Python test runner.
256
+
257
+ Example:
258
+
259
+ .. code-block:: console
260
+
261
+ pytest
262
+
263
+ License
264
+ -------
265
+
266
+ See the project license for details.
@@ -0,0 +1,223 @@
1
+ csvsmith
2
+ ========
3
+
4
+ .. image:: https://img.shields.io/pypi/v/csvsmith.svg
5
+ :target: https://pypi.org/project/csvsmith/
6
+ :alt: PyPI version
7
+
8
+ .. image:: https://img.shields.io/pypi/pyversions/csvsmith.svg
9
+ :target: https://pypi.org/project/csvsmith/
10
+ :alt: Supported Python versions
11
+
12
+ .. image:: https://img.shields.io/pypi/l/csvsmith.svg
13
+ :target: https://opensource.org/licenses/
14
+ :alt: License
15
+
16
+ .. image:: https://img.shields.io/badge/docs-Read%20the%20Docs-blue.svg
17
+ :target: https://csvsmith.readthedocs.io/en/latest/
18
+ :alt: Documentation
19
+
20
+ Small, focused CSV utilities for common data wrangling tasks.
21
+
22
+ ``csvsmith`` provides a handful of practical tools for working with CSV
23
+ files, including cleaning numeric values, filtering rows, deduplicating
24
+ records, classifying files, converting Excel spreadsheets to CSV, moving
25
+ files by suffix, and finding matches inside CSV content.
26
+
27
+ Documentation
28
+ -------------
29
+
30
+ Read the full documentation at:
31
+
32
+ https://csvsmith.readthedocs.io/en/latest/
33
+
34
+ Features
35
+ --------
36
+
37
+ - Clean numeric strings into normalized values
38
+ - Filter CSV rows by substring matching
39
+ - Deduplicate row data and generate reports
40
+ - Classify CSV files into folders based on headers/signatures
41
+ - Convert Excel workbooks to CSV
42
+ - Move files by suffix
43
+ - Find matching values inside CSV files
44
+ - Use the tools either from Python or from the command line
45
+
46
+ Installation
47
+ ------------
48
+
49
+ Install the package in your environment as usual for your project setup.
50
+
51
+ Example:
52
+
53
+ .. code-block:: console
54
+
55
+ pip install csvsmith
56
+
57
+ If you are developing locally, install it in editable mode from the project
58
+ root:
59
+
60
+ .. code-block:: console
61
+
62
+ pip install -e .
63
+
64
+ Quick start
65
+ -----------
66
+
67
+ You can use the library from Python:
68
+
69
+ .. code-block:: python
70
+
71
+ from csvsmith import (
72
+ clean_numeric,
73
+ dedupe_with_report,
74
+ excel_to_csv,
75
+ find_matches_in_csv,
76
+ move_by_suffix,
77
+ )
78
+
79
+ print(clean_numeric("1,234.56"))
80
+
81
+ Or use the command-line interface:
82
+
83
+ .. code-block:: console
84
+
85
+ csvsmith --help
86
+
87
+ Command-line usage
88
+ ------------------
89
+
90
+ The package provides a CLI with several subcommands.
91
+
92
+ Clean numeric values:
93
+
94
+ .. code-block:: console
95
+
96
+ csvsmith clean-numeric "1,234.56" --sep "," --decimal "."
97
+
98
+ Filter rows in a CSV:
99
+
100
+ .. code-block:: console
101
+
102
+ csvsmith drop-rows input.csv notes spam --case-insensitive --drop-header
103
+
104
+ Deduplicate rows:
105
+
106
+ .. code-block:: console
107
+
108
+ csvsmith dedupe input.csv -o out.csv --subset id --keep first
109
+
110
+ Classify CSV files:
111
+
112
+ .. code-block:: console
113
+
114
+ csvsmith classify src_dir dst_dir --mode relaxed --match subset --auto --dry-run
115
+
116
+ Convert Excel to CSV:
117
+
118
+ .. code-block:: console
119
+
120
+ csvsmith excel2csv input.xlsx
121
+
122
+ Move files by suffix:
123
+
124
+ .. code-block:: console
125
+
126
+ csvsmith move-files src_dir dst_dir --suffixes .csv,.pdf
127
+
128
+ Find matches in a CSV:
129
+
130
+ .. code-block:: console
131
+
132
+ csvsmith find-matches input.csv target --ignore-case --ignore-whitespace
133
+
134
+ Find matches in a CSV
135
+ ---------------------
136
+
137
+ ``find_matches_in_csv`` searches a CSV file for a target value and returns
138
+ match records containing coordinates and row context information.
139
+
140
+ Python API:
141
+
142
+ .. code-block:: python
143
+
144
+ from csvsmith import find_matches_in_csv
145
+
146
+ results = find_matches_in_csv("input.csv", "target")
147
+
148
+ CLI:
149
+
150
+ .. code-block:: console
151
+
152
+ csvsmith find-matches input.csv target
153
+
154
+ Options:
155
+
156
+ - ``--ignore-case``: ignore case while matching
157
+ - ``--ignore-whitespace``: ignore whitespace while matching
158
+ - ``--no-nfkc``: disable NFKC normalization
159
+
160
+ If matches are found, the CLI prints formatted JSON. If no matches are found,
161
+ it prints a simple message.
162
+
163
+ Other Python APIs
164
+ -----------------
165
+
166
+ The package also exposes a few other helper functions and classes from its
167
+ top-level API.
168
+
169
+ Numeric and row tools:
170
+
171
+ .. code-block:: python
172
+
173
+ from csvsmith import (
174
+ clean_numeric,
175
+ count_duplicates_sorted,
176
+ add_row_digest,
177
+ find_duplicate_rows,
178
+ dedupe_with_report,
179
+ read_csv_rows,
180
+ write_csv_rows,
181
+ )
182
+
183
+ CSV classification and filtering:
184
+
185
+ .. code-block:: python
186
+
187
+ from csvsmith import CSVClassifier, DropRowsBySubstring, CSVCleaner
188
+
189
+ File and conversion helpers:
190
+
191
+ .. code-block:: python
192
+
193
+ from csvsmith import excel_to_csv, move_by_suffix
194
+
195
+ String comparison utilities:
196
+
197
+ .. code-block:: python
198
+
199
+ from csvsmith import StringDistance, Relation, Result, analyze_pair
200
+
201
+ Project structure
202
+ -----------------
203
+
204
+ The code is organized into two main areas:
205
+
206
+ - ``csvsmith.tools`` for higher-level CSV workflows
207
+ - ``csvsmith.utils`` for reusable utility helpers
208
+
209
+ Testing
210
+ -------
211
+
212
+ Run the test suite with your preferred Python test runner.
213
+
214
+ Example:
215
+
216
+ .. code-block:: console
217
+
218
+ pytest
219
+
220
+ License
221
+ -------
222
+
223
+ See the project license for details.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "csvsmith"
7
- version = "0.7.0"
7
+ version = "0.7.2"
8
8
  description = "Small CSV utilities: row deduplication, classification, row filtering, and CLI helpers."
9
9
  readme = "README.rst"
10
10
  requires-python = ">=3.10"
@@ -38,6 +38,7 @@ dependencies = [
38
38
  [project.urls]
39
39
  Homepage = "https://github.com/yeiichi/csvsmith"
40
40
  Repository = "https://github.com/yeiichi/csvsmith"
41
+ Documentation = "https://csvsmith.readthedocs.io/en/latest/"
41
42
 
42
43
  [project.scripts]
43
44
  csvsmith = "csvsmith.cli:main"
@@ -31,24 +31,25 @@ Submodules:
31
31
  - csvsmith.cli (CLI entrypoint)
32
32
  """
33
33
 
34
- __version__ = "0.7.0"
34
+ __version__ = "0.7.2"
35
35
 
36
- from .tools.clean_numeric import clean_numeric
36
+ from .tools.classify import CSVClassifier
37
+ from .tools.excel2csv import excel_to_csv
38
+ from .tools.filter_rows import DropRowsBySubstring
39
+ from .tools.find_matches_in_csv import find_matches_in_csv
40
+ from .tools.move_files import move_by_suffix
37
41
  from .tools.row_dedup import (
38
42
  add_row_digest,
39
43
  find_duplicate_rows,
40
44
  dedupe_with_report,
41
45
  )
46
+ from .utils.clean_numeric import clean_numeric
47
+ from .utils.distance import StringDistance, Relation, Result, analyze_pair
42
48
  from .utils.io import (
43
49
  count_duplicates_sorted,
44
50
  read_csv_rows,
45
51
  write_csv_rows,
46
52
  )
47
- from .tools.classify import CSVClassifier
48
- from .tools.filter_rows import DropRowsBySubstring, CSVCleaner
49
- from .tools.excel2csv import excel_to_csv
50
- from .tools.move_files import move_by_suffix
51
- from .utils.distance import StringDistance, Relation, Result, analyze_pair
52
53
 
53
54
  __all__ = [
54
55
  "count_duplicates_sorted",
@@ -61,6 +62,7 @@ __all__ = [
61
62
  "DropRowsBySubstring",
62
63
  "excel_to_csv",
63
64
  "move_by_suffix",
65
+ "find_matches_in_csv",
64
66
  "StringDistance",
65
67
  "Relation",
66
68
  "Result",
@@ -9,7 +9,7 @@ from typing import Optional, Sequence
9
9
  from . import __version__
10
10
  from .tools.classify import CSVClassifier
11
11
  from .tools.excel2csv import excel_to_csv
12
- from .tools.clean_numeric import clean_numeric
12
+ from .utils.clean_numeric import clean_numeric
13
13
  from .tools.filter_rows import DropRowsBySubstring
14
14
  from .tools.move_files import move_by_suffix, normalize_suffixes
15
15
  from .tools.row_dedup import (