Skip to content

Convert a CSVW document (CSV metadata) to a DuckDB query to load a CSV file into a database.

License

Notifications You must be signed in to change notification settings

CUREd-Plus/csvw-duckdb

Repository files navigation

Test Python code

CSVW DuckDB tool

Convert a CSVW document (CSV metadata) to a DuckDB query to load a CSV file into a database.

See also: Python csvw package.

Installation

pip install csvw-duckdb

Usage

To use this tool, call it from the command line and provide the path of the CSVW document. The SQL code will be written to the screen.

csvw-duckdb --help
usage: csvw-duckdb [-h] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--version] csvw_path

Load a CSVW document and generate simple SQL SELECT statements. One SQL file will be generated per table in the CSVW table group.

positional arguments:
  csvw_path             CSVW file

options:
  -h, --help            show this help message and exit
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}, -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}
  --version             show program's version number and exi

Examples

csvw-duckdb my_metadata.csvw

About

Convert a CSVW document (CSV metadata) to a DuckDB query to load a CSV file into a database.

Topics

Resources

License

Stars

Watchers

Forks

Languages