turbot/csv

GitHub
steampipe plugin install csvsteampipe plugin install csv

CSV + Steampipe

A comma-separated values (CSV) file is a delimited text file that contains records of data.

Steampipe is an open source CLI to instantly query data using SQL.

Query data from the users.csv file:

select
first_name,
last_name
from
users;
+------------+-----------+
| first_name | last_name |
+------------+-----------+
| Michael | Scott |
| Dwight | Schrute |
+------------+-----------+

Documentation

Get started

Install

Download and install the latest CSV plugin:

steampipe plugin install csv

Credentials

No credentials are required.

Configuration

Installing the latest csv plugin will create a config file (~/.steampipe/config/csv.spc) with a single connection named csv:

connection "csv" {
plugin = "csv"
# Paths is a list of locations to search for CSV files
# All paths are resolved relative to the current working directory (CWD)
# Wildcard based searches are supported, including recursive searches
# For example:
# - "*.csv" matches all CSV files in the CWD
# - "*.csv.gz" matches all gzipped CSV files in the CWD
# - "**/*.csv" matches all CSV files in the CWD and all sub-directories
# - "../*.csv" matches all CSV files in the CWD's parent directory
# - "steampipe*.csv" matches all CSV files starting with "steampipe" in the CWD
# - "/path/to/dir/*.csv" matches all CSV files in a specific directory
# - "/path/to/dir/custom.csv" matches a specific file
# If paths includes "*", all files (including non-CSV files) in
# the CWD will be matched, which may cause errors if incompatible file types exist
# Defaults to CWD
paths = [ "*.csv", "*.csv.gz" ]
# The field delimiter character when parsing CSV files. Must be a single
# character. Defaults to comma.
# separator = ","
# If set, then lines beginning with the comment character without preceding
# whitespace are ignored. Disabled by default.
# comment = "#"
# Determine whether to use the first row as the header row when creating column names.
# Valid values are "auto", "on", "off":
# - "auto": If there are no empty or duplicate values use the first row as the header; else, use the first row as a data row and use generic column names, e.g., "a", "b".
# - "on": Use the first row as the header. If there are empty or duplicate values, the tables will fail to load.
# - "off": Do not use the first row as the header. All column names will be generic.
# Defaults to "auto".
# header = "auto"
}
  • paths - A list of directory paths to search for CSV files. Paths are resolved relative to the current working directory. Paths may include wildcards and also supports ** for recursive matching. Defaults to the current working directory.
  • separator - Field delimiter when parsing files. Defaults to ,.
  • comment - Lines starting with this comment character are ignored. Disabled by default.
  • header - Whether to use the first row as the header row when creating column names. Valid values are "auto", "on", "off". Defaults to "auto". For more information, please see Column Names.

Get involved