Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xyluo25/exceltosqlserver
This package help to convert your excel files (xlsx,xls,csv) to SQL Server database.
https://github.com/xyluo25/exceltosqlserver
dababase excel-csv sql-server transformer
Last synced: about 19 hours ago
JSON representation
This package help to convert your excel files (xlsx,xls,csv) to SQL Server database.
- Host: GitHub
- URL: https://github.com/xyluo25/exceltosqlserver
- Owner: xyluo25
- License: mit
- Created: 2020-12-29T01:16:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-03T21:09:49.000Z (10 months ago)
- Last Synced: 2024-12-14T02:46:30.719Z (9 days ago)
- Topics: dababase, excel-csv, sql-server, transformer
- Language: Python
- Homepage: https://exceltosqlserver.readthedocs.io/en/latest/
- Size: 136 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
This package help to convert your excel files (xlsx,xls,csv) to SQL Server database.
# Installation
exceltosqlserver can be installed as:
```python
pip install exceltosqlserver
```# Dependency
👍 [pandas](https://pandas.pydata.org/)
👍 [pyodbc](https://github.com/mkleehammer/pyodbc)
👍 [sqlalchemy](https://www.sqlalchemy.org/)
# QuickStart
```python
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()```
```python
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.