A simple and fast cli application to load a csv into postgres
Project description
csv2pg
A simple and fast cli application to load a csv into postgres
Installation
pip install --user csv2pg
Usage
csv2pg --help
csv2pg expects the same parameter than psql to setup the postgres connection
# Loading data.csv into public.my_table
csv2pg -h localhost -p 5432 -U postgres -d postgres public.my_table data.csv --verbose
# Using postgres env to set connection variables
PGHOST=mypg.host.com PGPORT=5432 PGDATABASE=mydb PGUSER=myuser csv2pg public.my_table data.csv --verbose
Basic database utilities
csv2pg will automatically create the table using the header of the csv file. Caution, the option --overwrite
will drop the table before inserting the new records in.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
csv2pg-1.0.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for csv2pg-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c601c6f20bbde9debe05f1898a471a6226896f8b5f6a57bc65a6a0a6c9f2a60 |
|
MD5 | cce4fb93a100edc96e4d9ba194b9c441 |
|
BLAKE2b-256 | 45539799c8261fc34ba96b01af2edcc2db77e84a08eae7419c5ab9d8224672b3 |