csv-import-analyzer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d57394db99e42dd7154c4c1506d94fa7310311db
4
- data.tar.gz: 3b07ff8c14728eb61ceca8ecf107b1be6dea3344
3
+ metadata.gz: ee90d874a0f66c6afa025f62674ae33ce6e30bd3
4
+ data.tar.gz: 8d1ba51822c35cad14fb72e85cd43dc5f928686c
5
5
  SHA512:
6
- metadata.gz: 4942b31ef92123e2fbedbe1b73eb1aa2814ed459d2b875f4435fb607eb4c072d7f10164bae285ee4ed1af0404ccebab73194526eacb786f9422a3c3540e8f66b
7
- data.tar.gz: ad717f58dac4d563f6cf1edfb89ec14ca6299c18e6714b45fa1ccf6f78d93f758f7fd66952b76fe52cab07c414405070523c16446f98a45644f7209b3087915f
6
+ metadata.gz: 7d1d1015c91546e1adcfa871f1b8a2a0516113dfa297b21c97aaa4c713751bf3539de3f1df5379a732df3309dd1e6bb9dac6992cfe814f8464c97b86e55207d6
7
+ data.tar.gz: 194cbfd9937a3923dbdd629b3c5b810d6d5a84de0f08ea8b7d1e8e6d341959c11cb444216f2ab0dc754d4b640bbe3ca266c7183fbbaf4e7b82ae2306848dfea5
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ *.gem
data/README.md CHANGED
@@ -24,7 +24,19 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
- TODO: Write usage instructions here
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
 
@@ -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 = ["avinash vallabhaneni"]
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}
@@ -1,5 +1,5 @@
1
1
  module CsvImportAnalyzer
2
2
  module Version
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -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/lib/sampleTab.csv' HEADER DELIMITER ',' CSV NULL AS 'NULL';"
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/lib/sampleTab.csv' HEADER DELIMITER ',' CSV NULL AS 'NULL';"
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - avinash vallabhaneni
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
- - lib/metadata_output.json
144
- - lib/sampleTab.csv
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