csv_sniffer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -7
- data/csv_sniffer.gemspec +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad85431534479a065a967c635b40262075688649
|
4
|
+
data.tar.gz: 1bf4f25c6628a1a83c06f36319d9178517d2f6c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75ab53bcd1b9db8a182ff93b09dbdbf59ac7a934fef724905248ead35b4fe3f2e0d07c88314a001d7145fa0ca29f3f65c22bcde5d88447e6fd7f34164711e892
|
7
|
+
data.tar.gz: ed4b9829deac6773b429d5217e5778df3581e8048b46e19170de1ad91b8c41b3bc5677d2f7548213c0c907dac90169e5fc9b22d6e4f754a2d93950517ab49092
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CSV Sniffer
|
2
2
|
|
3
|
-
CSV Sniffer is
|
3
|
+
CSV Sniffer is a set of functions that allow a user heuristically detect the delimiter character in use, whether the values in the CSV file are quote enclosed, whether the file contains a header, and more. The library is intended to detect information to be used as configuration inputs for CSV parsers. For delimiter detection the following delimiters are currently supported `[",", "\t", "|", ";"]`
|
4
4
|
|
5
5
|
To ensure high performance and a low memory footprint, the library uses as little information as needed to make accurate decisions. Contributors are welcome to
|
6
6
|
improve the algorithms in use.
|
@@ -14,7 +14,7 @@ $ gem install csv_sniffer
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
|
-
Given a `
|
17
|
+
Given a `some_file.csv` file:
|
18
18
|
|
19
19
|
```csv
|
20
20
|
Name;Phone
|
@@ -27,8 +27,9 @@ Detection usage is as follows:
|
|
27
27
|
```rb
|
28
28
|
require "csv_sniffer"
|
29
29
|
|
30
|
-
delim = CsvSniffer.detect_delimiter("/path/to/
|
31
|
-
is_quote_enclosed = CsvSniffer.is_quote_enclosed?("/path/to/
|
30
|
+
delim = CsvSniffer.detect_delimiter("/path/to/some_file.csv") #=> ";"
|
31
|
+
is_quote_enclosed = CsvSniffer.is_quote_enclosed?("/path/to/some_file.csv") #=> false
|
32
|
+
has_header = CsvSniffer.has_header?("/path/to/some_file.csv") #=> true
|
32
33
|
```
|
33
34
|
|
34
35
|
See [`test_csv_sniffer.rb`](test/test_csv_sniffer.rb) for more examples.
|
@@ -37,11 +38,9 @@ See [`test_csv_sniffer.rb`](test/test_csv_sniffer.rb) for more examples.
|
|
37
38
|
## Tests
|
38
39
|
|
39
40
|
```
|
40
|
-
$
|
41
|
+
$ rake test
|
41
42
|
```
|
42
43
|
|
43
|
-
## To Do
|
44
|
-
- Header detection
|
45
44
|
|
46
45
|
## License
|
47
46
|
|
data/csv_sniffer.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'csv_sniffer'
|
3
|
-
s.version = '0.1.
|
4
|
-
s.date = '2015-10-
|
3
|
+
s.version = '0.1.1'
|
4
|
+
s.date = '2015-10-16'
|
5
5
|
s.summary = "CSV library for heuristic detection of CSV properties"
|
6
|
-
s.description = "CSV Sniffer is
|
6
|
+
s.description = "CSV Sniffer is a set of functions that allow a user detect the delimiter character in use, whether the values in the CSV file are quote enclosed, whether the file contains a header, and more. The library is intended to detect information to be used as configuration inputs for CSV parsers."
|
7
7
|
s.authors = ["Tim Ojo"]
|
8
8
|
s.email = 'ojo.tim@gmail.com'
|
9
9
|
s.homepage = 'https://github.com/tim-ojo/csv_sniffer'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_sniffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Ojo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description: CSV Sniffer is
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
description: CSV Sniffer is a set of functions that allow a user detect the delimiter
|
28
|
+
character in use, whether the values in the CSV file are quote enclosed, whether
|
29
|
+
the file contains a header, and more. The library is intended to detect information
|
30
|
+
to be used as configuration inputs for CSV parsers.
|
31
31
|
email: ojo.tim@gmail.com
|
32
32
|
executables: []
|
33
33
|
extensions: []
|