1CSVPY(1) csvkit CSVPY(1)
2
3
4
6 csvpy - csvpy Documentation
7
9 Loads a CSV file into a agate.csv.Reader object and then drops into a
10 Python shell so the user can inspect the data however they see fit:
11
12 usage: csvpy [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b]
13 [-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING] [-L LOCALE]
14 [-S] [--blanks] [--date-format DATE_FORMAT]
15 [--datetime-format DATETIME_FORMAT] [-H] [-K SKIP_LINES] [-v]
16 [-l] [--zero] [-V] [--dict] [--agate]
17 [FILE]
18
19 Load a CSV file into a CSV reader and then drop into a Python shell.
20
21 positional arguments:
22 FILE The CSV file to operate on. If omitted, will accept
23 input on STDIN.
24
25 optional arguments:
26 -h, --help show this help message and exit
27 --dict Load the CSV file into a DictReader.
28 --agate Load the CSV file into an agate table.
29
30 This tool will automatically use the IPython shell if it is installed,
31 otherwise it will use the running Python shell.
32
33 NOTE:
34 Due to platform limitations, csvpy does not accept file input on
35 STDIN.
36
37 See also: ../common_arguments.
38
40 Basic use:
41
42 csvpy examples/dummy.csv
43 Welcome! "examples/dummy.csv" has been loaded in a reader object named "reader".
44 >>> reader.next()
45 [u'a', u'b', u'c']
46
47 As a dictionary:
48
49 csvpy --dict examples/dummy.csv
50 Welcome! "examples/dummy.csv" has been loaded in a DictReader object named "reader".
51 >>> reader.next()
52 {u'a': u'1', u'c': u'3', u'b': u'2'}
53
54 As an agate table:
55
56 csvpy --agate examples/dummy.csv
57 Welcome! "examples/dummy.csv" has been loaded in a from_csv object named "reader".
58 >>> reader.print_table()
59 | a | b | c |
60 | ---- | - | - |
61 | True | 2 | 3 |
62
64 Christopher Groskopf
65
67 2019, Christopher Groskopf
68
69
70
71
721.0.4 Aug 01, 2019 CSVPY(1)