Skip to main content

This package help convert your excel files (xlsx,xls,csv) to Postgresql Database.

Project description

exceltopostgresql

Automatically save your local excel files (xlsx,xls,csv) onto Postgresql database

Introduction

This package help to convert your excel files (xlsx,xls,csv) to postgresql database.

Installation

exceltopostgresql can be installed as:

pip install exceltopostgresql

Dependency

👍 pandas

👍 psycopg2

👍 sqlalchemy

QuickStart

import exceltopostgresql as ep
# generate the class instance

# STEP One, prepare your input pareameters

yourFile  = "test01.xls"  # available for xlsx, xls,csv
yourUsrID = ""
yourPWD   = ""
yourDBname= ""
rename_table = ""
	# "": save your file name as table name onto posgtresql
	# or
	# customize your table, like: "test"

# get your local host name
# this will return your local computer name for your sql server database
host_name = ep.hostname
or
host_name = "localhost"

# get your local ip address
# this will return your local ip address (if your sql server can be accessed by DNS)
ip = ep.local_ip

# you need to change your host if needed, dns: local ip address
#yourHostORip  = "localhost"
# yourHostORip  = host_name
yourHostORip  = ip


# STEP Two connect to postgresql server and load your input data
ep.exceltoDBtable(yourFile,yourHostORip,yourUsrID,yourPWD,yourDBname,save2tableName)

# STEP Three, save loaded data onto postgresql
ep.save2db()
output:
Successfully load excel data...
Secessfully connected to postgresql...
Secessfully saved 'yourtable' to Postgresql...

API Reference

exceltopostgresql.ExcelToDB(filePath, host_ip="", usrID ="", pwd="", database_name="", port= "5432", rename_table="")

Args:
            filePath (str): [path of your input file name]
            host_ip (bool, optional): the ip of your host machine. Defaults to "".
            usrID (bool, optional): user id of your postgresql database. Defaults to "".
            pwd (bool, optional): password of your postgresql database. Defaults to "".
            database_name (bool, optional): the exact database name you want your data save to. Defaults to "".
            port (str, optional): the postgresql port. Defaults to "5432".
            rename_table (bool, optional): rename your input table.
                if "", will use exact the same table name of your input file. Defaults to "".

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

exceltopostgresql-0.2.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

exceltopostgresql-0.2.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file exceltopostgresql-0.2.4.tar.gz.

File metadata

  • Download URL: exceltopostgresql-0.2.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for exceltopostgresql-0.2.4.tar.gz
Algorithm Hash digest
SHA256 00b6935818283e55c7de7ddd5eb5990add7635f890fe79e442a856428f33f018
MD5 729f3c9a3ad1aaa0c0f5f18e54202f4f
BLAKE2b-256 9348e6833da7453a7d9db3230ea139ea27a7baa08c073f5037eb797058fb5f6c

See more details on using hashes here.

File details

Details for the file exceltopostgresql-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for exceltopostgresql-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 366b044ee926cead43eb06b7221638d711e375c559e0c0403e830d51279d0c92
MD5 bc5675f9d2c202f606cddc0867179f82
BLAKE2b-256 b3dc454dad4799a6d53cd919457a07bf8aabe1b6beadf8382b6cf6fd3ba54ff8

See more details on using hashes here.

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