csv2psql 0.0.11 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5299e63f4ab0f21575bc04d1b0f4e863f3121197
4
- data.tar.gz: 32532a0c828576f90c016f51a880756c4161ee71
3
+ metadata.gz: 403c981b7b0dda9cef22593e30515652936f4bd9
4
+ data.tar.gz: 87bf7ebe76a2d613489f3a3358262cd13c236451
5
5
  SHA512:
6
- metadata.gz: b227bf6c07fff2c0beafe9bfdba44654aaf372c2852ebf4d7430ac95cbd5478fc7cf2d4c0b26d0a168f551bd753f8997ebf17d54b8b59896b3614fe1df9cc394
7
- data.tar.gz: 41595c98914f724d354b530e5fa9a21082d3d03b490e99e6cfb5b1efe6c60be1214b164f38403353d448bf42cc67bdf8a9fe93dde3ee4c5f955d9c3afb9b253b
6
+ metadata.gz: 9011ba3f4fa5af974a392799f0c056ff0c96238125d80d12729eb5a24d1766d7320058958600ba65f392c013e792c46387e4e1c12003657c87335ad8ad105cf6
7
+ data.tar.gz: 375eed254a3079090c6f5250c36eba80249c8cbc486574f7472bb969eb30f456a9f717918e46cb212cee9e6aa93d7d83ad6db74e8b010b8dbe46432100f17856
data/README.md CHANGED
@@ -48,7 +48,7 @@ csv2psql convert data/sample.csv
48
48
  csv2psql help
49
49
 
50
50
  NAME
51
- csv2psql - csv2psql 0.0.9 (Codename: Flying fish)
51
+ csv2psql - csv2psql 0.0.12 (Codename: Prudent owl)
52
52
 
53
53
  SYNOPSIS
54
54
  csv2psql [global options] command [command options] [arguments...]
@@ -57,14 +57,17 @@ GLOBAL OPTIONS
57
57
  -d, --delimiter=arg - Column delimiter (default: ,)
58
58
  -h, --[no-]header - Header row included (default: enabled)
59
59
  --help - Show this message
60
+ -l, --limit=arg - How many rows process (default: -1)
60
61
  -q, --quote=arg - Quoting character (default: ")
61
- -s, --separator=arg - Line separator (default: auto)
62
+ -s, --separator=arg - Line separator (default: none)
63
+ --skip=arg - How many rows skip (default: -1)
62
64
 
63
65
  COMMANDS
64
66
  analyze - Analyze csv file
65
67
  convert - Convert csv file
66
68
  help - Shows a list of commands or help for one command
67
- version - Print version info
69
+ schema - Generate schema for file
70
+ version - Print version info```
68
71
  ```
69
72
 
70
73
  **Analyze help**
@@ -101,6 +104,21 @@ COMMAND OPTIONS
101
104
  --[no-]truncate-table - Truncate SQL Table before inserts
102
105
  ```
103
106
 
107
+ **Schema help**
108
+
109
+ ```
110
+ csv2psql help schema
111
+
112
+ NAME
113
+ schema - Generate schema for file
114
+
115
+ SYNOPSIS
116
+ csv2psql [global options] schema [command options]
117
+
118
+ COMMAND OPTIONS
119
+ -f, --format=arg - Output format (default: json)
120
+ ```
121
+
104
122
  ## Example
105
123
 
106
124
  **Input CSV**
@@ -220,6 +238,67 @@ csv2psql analyze --format=table tmp/sfpd_incident_2013.csv
220
238
  +------------+--------+-----------+---------+------+--------+------+
221
239
  ```
222
240
 
241
+ **Schema guess**
242
+
243
+ ```
244
+ csv2psql schema -f table ./data/census_SFOH_2010.csv
245
+
246
+ +-------------------------------------------------+---------+---------+
247
+ | ./data/census_SFOH_2010.csv |
248
+ +-------------------------------------------------+---------+---------+
249
+ | column | type | null |
250
+ +-------------------------------------------------+---------+---------+
251
+ | MSA | text | false |
252
+ | Tract ID | bigint | false |
253
+ | White Alone | bigint | false |
254
+ | Black or African American alone | bigint | false |
255
+ | Asian alone | bigint | false |
256
+ | Family Households | bigint | false |
257
+ | Nonfamily Households | bigint | false |
258
+ | Household income: < 10k | bigint | false |
259
+ | Household income: 10-15k | bigint | false |
260
+ | Household income: 15-20k | bigint | false |
261
+ | Household income: 20-25k | bigint | false |
262
+ | Household income: 25-30k | bigint | false |
263
+ | Household income: 30-35k | bigint | false |
264
+ | Household income: 35-40k | bigint | false |
265
+ | Household income: 40-45k | bigint | false |
266
+ | Household income: 45-50k | bigint | false |
267
+ | Household income: 50-60k | bigint | false |
268
+ | Household income: 60-75k | bigint | false |
269
+ | Household income: 75-100k | bigint | false |
270
+ | Household income: 100-125k | bigint | false |
271
+ | Household income: 125-150k | bigint | false |
272
+ | Household income: 150-200k | bigint | false |
273
+ | Household income: > 200k | bigint | false |
274
+ | With wage or salary income | bigint | false |
275
+ | No wage or salary income | bigint | false |
276
+ | With self-employment income | bigint | false |
277
+ | No self-employment income | bigint | false |
278
+ | With interest dividends or net rental income | bigint | false |
279
+ | No interest dividends or net rental income | bigint | false |
280
+ | With Social Security income | bigint | false |
281
+ | No Social Security income | bigint | false |
282
+ | With Supplemental Security Income (SSI) | bigint | false |
283
+ | No Supplemental Security Income (SSI) | bigint | false |
284
+ | With public assistance income | bigint | false |
285
+ | No public assistance income | bigint | false |
286
+ | With cash public assistance or Food Stamps/SNAP | bigint | false |
287
+ | No cash public assistance or Food Stamps/SNAP | bigint | false |
288
+ | With retirement income | bigint | false |
289
+ | No retirement income | bigint | false |
290
+ | Per capita income (2010 dollars) | bigint | true |
291
+ | Housing units | bigint | false |
292
+ | Occupancy status: Occupied | bigint | false |
293
+ | Occupancy status: Vacant | bigint | false |
294
+ | Housing tenure: Owner-occupied | bigint | false |
295
+ | Housing tenure: Renter-occupied | bigint | false |
296
+ | Median number of rooms | decimal | true |
297
+ | Median gross rent (dollars) | bigint | true |
298
+ | Median value for owner-occupied housing | bigint | true |
299
+ +-------------------------------------------------+---------+---------+
300
+ ```
301
+
223
302
  ## Contributing to csv2psql
224
303
 
225
304
  - Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet