Skip to main content

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

Project description

Introduction

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

Installation

exceltosqlserver can be installed as:

pip install exceltosqlserver

Dependency

👍 pandas

👍 pyodbc

👍 sqlalchemy

QuickStart

from exceltosqlserver import ExcelToDB, hostname, local_ip

# STEP One, prepare your input pareameters

yourFile  = "test01.xls"  # available for xlsx, xls,csv
yourUsrID = ""
yourPWD   = ""
yourDBname= ""
rename_table = ""  # Use your filename as tablename onto SQL Server or user define the table name, e.g. :"test"

# get your local host name
# this will return your local computer name for your sql server database
host_name = hostname

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

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


# STEP Two add your data to sql server
es = ExcelToDB(yourFile, yourHostORip, yourUsrID, yourPWD, yourDBname, rename_table)
es.save2db()
output:
Successfully load excel data...
Sucessfully connected to SQL Server...
Sucessfully saved 'yourtable' to SQL Server...

API Reference

exceltosqlserver.ExcelToDB(filePath,host_ip=False,usrID =False,pwd=False,db_name=False,rename_table)

filePath: str

host_ip: str default: ""

usrID: str default: ""

pwd: str default: ""

db_name: str default: ""

rename_table: str default: "", will auto save your filename as table name to sql server database. If assignmed value, will change table name from your filename to the assigned value.

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

exceltosqlserver-0.2.5.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

exceltosqlserver-0.2.5-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

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