Skip to main content

Reading CSV file and insert into database

Project description

Read csv and insert into DB

Requirements

  • Python 3.x

  • hashlib

  • pandas

  • sqlalchemy

  • shelve

  • numpy

Installation

$ pip install pycsvdb

Example

from pycsvdb import CsvManage

CsvManage(db_config_file="config.ini", file_name="filename.csv", primary_key="id", table_name="table_name")

Confi.ini format

[DB]


sqlalchemy.url = postgresql://postgres:password@localhost:5432/postgres

stage_schema = stage_table

prod_schema = prod_table

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycsvdb-2.3.tar.gz (4.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page