CSVPY(1)
β¨ NAME β¨
csvpy β csvpy Documentation
bestie she's a lil legend from the csvkit manual (that's the manual name, we're literally in it π ) and she's here to hand you a loaded-up CSV object and a whole Python shell to play in ππ
π DESCRIPTION π
okay so here's the vibe: csvpy loads a CSV file into an agate.csv.Reader object and then drops you straight into a Python shell so you can inspect the data however you see fit. main character energy fr fr.
Here's the literal help text, no edits, no cap:
usage: csvpy [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b]
[-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING] [-L LOCALE]
[-S] [--blanks] [--null-value NULL_VALUES [NULL_VALUES ...]]
[--date-format DATE_FORMAT] [--datetime-format DATETIME_FORMAT]
[-H] [-K SKIP_LINES] [-v] [-l] [--zero] [-V] [--dict] [--agate]
[--no-number-ellipsis] [-y SNIFF_LIMIT] [-I]
[FILE]
Load a CSV file into a CSV reader and then drop into a Python shell.
positional arguments:
FILE The CSV file to operate on. If omitted, will accept
input as piped data via STDIN.
optional arguments:
-h, --help show this help message and exit
--dict Load the CSV file into a DictReader.
--agate Load the CSV file into an agate table.
--no-number-ellipsis Disable the ellipsis if the max precision is exceeded.
-y SNIFF_LIMIT, --snifflimit SNIFF_LIMIT
Limit CSV dialect sniffing to the specified number of
bytes. Specify "0" to disable sniffing entirely, or
"-1" to sniff the entire file.
-I, --no-inference Disable type inference (and --locale, --date-format,
--datetime-format, --no-leading-zeroes) when parsing
the input.
and now let me translate that for you, cutie by cutie π
πΈ the positional argument πΈ
FILEβ the CSV file you wanna operate on. if you omit it, she'll accept input as piped data viaSTDIN.
π the optional arguments π
-h,--helpβ shows this help message and dips. iconic behaviour.--dictβ loads the CSV file into aDictReader.--agateβ loads the CSV file into an agate table.--no-number-ellipsisβ disables the ellipsis if the max precision is exceeded.-y SNIFF_LIMIT,--snifflimit SNIFF_LIMITβ limits CSV dialect sniffing to the specified number of bytes. specify"0"to disable sniffing entirely, or"-1"to sniff the entire file. so many options, so much power β¨-I,--no-inferenceβ disables type inference (and--locale,--date-format,--datetime-format,--no-leading-zeroes) when parsing the input.
this tool will automatically use the IPython shell if it is installed, otherwise it will use the running Python shell. she's adaptable like that π¦
NOTE: due to platform limitations,csvpydoes not accept file input as piped data viaSTDIN. π i know. tragic. but that's just how it is.
See also: Arguments common to all tools. π
π EXAMPLES π
basic use π
$ csvpy examples/dummy.csv
Welcome! "examples/dummy.csv" has been loaded in a reader object
named "reader". >>> next(reader) ['a', 'b', 'c']
as a dictionary π
$ csvpy --dict examples/dummy.csv
Welcome! "examples/dummy.csv" has been loaded in a DictReader object named "reader".
>>> next(reader)
{'a': '1', 'c': '3', 'b': '2'}
as an agate table π
$ csvpy --agate examples/dummy.csv
Welcome! "examples/dummy.csv" has been loaded in a from_csv object named "reader".
>>> reader.print_table()
| a | b | c |
| ---- | - | - |
| True | 2 | 3 |
π AUTHOR π
Christopher Groskopf and contributors β shoutout to the whole squad π«Ά
π COPYRIGHT π
2016, Christopher Groskopf and James McKinney
and that's the whole page, bestie β¨ this was version 2.2.0, dated Aug 16, 2024, straight out of csvkit. go forth and next(reader) your way into the sunset π
ππ
π¦ where this page comes from
- arch rolling: csvkit 2.2.0-2 Β· MIT
- nixos 26.05: csvkit 2.2.0
- nixpkgs unstable: csvkit 2.2.0
- ubuntu resolute: csvkit 2.2.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms