csv-import-analyzer 0.0.1 → 0.0.2
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/.gitignore +1 -0
- data/README.md +13 -1
- data/csv-import-analyzer.gemspec +1 -1
- data/lib/csv-import-analyzer/version.rb +1 -1
- data/{lib → samples}/metadata_output.json +2 -2
- data/{lib → samples}/sampleTab.csv +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee90d874a0f66c6afa025f62674ae33ce6e30bd3
|
4
|
+
data.tar.gz: 8d1ba51822c35cad14fb72e85cd43dc5f928686c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d1d1015c91546e1adcfa871f1b8a2a0516113dfa297b21c97aaa4c713751bf3539de3f1df5379a732df3309dd1e6bb9dac6992cfe814f8464c97b86e55207d6
|
7
|
+
data.tar.gz: 194cbfd9937a3923dbdd629b3c5b810d6d5a84de0f08ea8b7d1e8e6d341959c11cb444216f2ab0dc754d4b640bbe3ca266c7183fbbaf4e7b82ae2306848dfea5
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,19 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
-
|
27
|
+
Calling process on a filename would generate a metadata_output.json which has the Delimiter, Datatype Analysis and SQL (create and import) statements for both PostgreSQL and MySQL
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
|
31
|
+
CsvImportAnalyzer.process(filename)
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
## TODO:
|
36
|
+
<ul>
|
37
|
+
<li> Return the analysis as Json object.</li>
|
38
|
+
<li> Structuring the analysis outputted to csv better </li>
|
39
|
+
</ul>
|
28
40
|
|
29
41
|
## Contributing
|
30
42
|
|
data/csv-import-analyzer.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'csv-import-analyzer/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "csv-import-analyzer"
|
8
8
|
spec.version = CsvImportAnalyzer::Version::VERSION
|
9
|
-
spec.authors = ["
|
9
|
+
spec.authors = ["Avinash Vallabhaneni"]
|
10
10
|
spec.email = ["avinash.vallab@gmail.com"]
|
11
11
|
spec.description = %q{Santize large csv files and help in predicting datatypes including min max values for easy import to SQL}
|
12
12
|
spec.summary = %q{To process large csv files and predict valid datatypes of each column for easy import into SQL}
|
@@ -60,11 +60,11 @@
|
|
60
60
|
"sql": {
|
61
61
|
"pg": {
|
62
62
|
"create_query": "create table sampletab.csv ( year_id int not null, make_id varchar(255) not null, model_id varchar(255) not null, description_id varchar(255), price_id float not null);",
|
63
|
-
"import_query": "COPY sampletab.csv FROM '/home/avinash/Desktop/csv-import-analyzer/
|
63
|
+
"import_query": "COPY sampletab.csv FROM '/home/avinash/Desktop/csv-import-analyzer/samples/sampleTab.csv' HEADER DELIMITER ',' CSV NULL AS 'NULL';"
|
64
64
|
},
|
65
65
|
"mysql": {
|
66
66
|
"create_query": "create table sampletab.csv ( year_id int not null, make_id varchar(255) not null, model_id varchar(255) not null, description_id varchar(255), price_id float not null);",
|
67
|
-
"import_query": "COPY sampletab.csv FROM '/home/avinash/Desktop/csv-import-analyzer/
|
67
|
+
"import_query": "COPY sampletab.csv FROM '/home/avinash/Desktop/csv-import-analyzer/samples/sampleTab.csv' HEADER DELIMITER ',' CSV NULL AS 'NULL';"
|
68
68
|
}
|
69
69
|
}
|
70
70
|
}
|
File without changes
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv-import-analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Avinash Vallabhaneni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -140,8 +140,8 @@ files:
|
|
140
140
|
- lib/csv-import-analyzer/sampleTab.csv
|
141
141
|
- lib/csv-import-analyzer/sql_query_builder.rb
|
142
142
|
- lib/csv-import-analyzer/version.rb
|
143
|
-
-
|
144
|
-
-
|
143
|
+
- samples/metadata_output.json
|
144
|
+
- samples/sampleTab.csv
|
145
145
|
- spec/csv-import-analyzer/analyzer/csv_check_bounds_spec.rb
|
146
146
|
- spec/csv-import-analyzer/analyzer/delimiter_identifier_spec.rb
|
147
147
|
- spec/csv-import-analyzer/analyzer/file_type_assertion_spec.rb
|