# 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/Xiangyongluo/exceltosqlserver",
"name": "exceltosqlserver",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "",
"author": "Xiangyong Luo",
"author_email": "rochemay@163.com",
"download_url": "https://files.pythonhosted.org/packages/94/91/080fb88076e70f1c8bf73fa60b7eb2353f9ce7929baf54540f5180c946b0/exceltosqlserver-0.2.5.tar.gz",
"platform": null,
"description": "# Introduction\r\n\r\nThis package help to convert your excel files (xlsx,xls,csv) to SQL Server database.\r\n\r\n# Installation\r\n\r\nexceltosqlserver can be installed as:\r\n\r\n```python\r\npip install exceltosqlserver\r\n```\r\n\r\n# Dependency\r\n\r\n\ud83d\udc4d [pandas](https://pandas.pydata.org/)\r\n\r\n\ud83d\udc4d [pyodbc](https://github.com/mkleehammer/pyodbc)\r\n\r\n\ud83d\udc4d [sqlalchemy](https://www.sqlalchemy.org/)\r\n\r\n# QuickStart\r\n\r\n```python\r\nfrom exceltosqlserver import ExcelToDB, hostname, local_ip\r\n\r\n# STEP One, prepare your input pareameters\r\n\r\nyourFile = \"test01.xls\" # available for xlsx, xls,csv\r\nyourUsrID = \"\"\r\nyourPWD = \"\"\r\nyourDBname= \"\"\r\nrename_table = \"\" # Use your filename as tablename onto SQL Server or user define the table name, e.g. :\"test\"\r\n\r\n# get your local host name\r\n# this will return your local computer name for your sql server database\r\nhost_name = hostname\r\n\r\n# get your local ip address\r\n# this will return your local ip address (if your sql server can be accessed by DNS)\r\nip = local_ip\r\n\r\n# you need to change your host if needed, dns: local ip address\r\n#yourHostORip = \"localhost\"\r\n# yourHostORip = host_name\r\nyourHostORip = ip\r\n\r\n\r\n# STEP Two add your data to sql server\r\nes = ExcelToDB(yourFile, yourHostORip, yourUsrID, yourPWD, yourDBname, rename_table)\r\nes.save2db()\r\n\r\n```\r\n\r\n```python\r\noutput:\r\nSuccessfully load excel data...\r\nSucessfully connected to SQL Server...\r\nSucessfully saved 'yourtable' to SQL Server...\r\n```\r\n\r\n# API Reference\r\n\r\nexceltosqlserver.ExcelToDB(`filePath,host_ip=False,usrID =False,pwd=False,db_name=False,rename_table`)\r\n\r\nfilePath: str\r\n\r\nhost_ip: str default: \"\"\r\n\r\nusrID: str default: \"\"\r\n\r\npwd: str default: \"\"\r\n\r\ndb_name: str default: \"\"\r\n\r\nrename_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.\r\n",
"bugtrack_url": null,
"license": "",
"summary": "This package help convert your excel files (xlsx,xls,csv) to SQL Server Database.",
"version": "0.2.5",
"project_urls": {
"Homepage": "https://github.com/Xiangyongluo/exceltosqlserver"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0777fa413cdc52b8acdbd9947c54803118f9e90331f44732ce628425c515c978",
"md5": "74e8ec22d6b010aaad5b020c81d70540",
"sha256": "b220404d0368d741303b7842a5e0458a3c36095d98b44bce3866d48baecd8b44"
},
"downloads": -1,
"filename": "exceltosqlserver-0.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "74e8ec22d6b010aaad5b020c81d70540",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 11906,
"upload_time": "2024-03-03T20:50:11",
"upload_time_iso_8601": "2024-03-03T20:50:11.659265Z",
"url": "https://files.pythonhosted.org/packages/07/77/fa413cdc52b8acdbd9947c54803118f9e90331f44732ce628425c515c978/exceltosqlserver-0.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9491080fb88076e70f1c8bf73fa60b7eb2353f9ce7929baf54540f5180c946b0",
"md5": "0771adebc2511ba22c0c278f2a433252",
"sha256": "7088f6cfc0b10e10c53d883ee41e698a5fa04b9d19796dccfe924595a09cd12f"
},
"downloads": -1,
"filename": "exceltosqlserver-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "0771adebc2511ba22c0c278f2a433252",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 12087,
"upload_time": "2024-03-03T20:50:13",
"upload_time_iso_8601": "2024-03-03T20:50:13.676970Z",
"url": "https://files.pythonhosted.org/packages/94/91/080fb88076e70f1c8bf73fa60b7eb2353f9ce7929baf54540f5180c946b0/exceltosqlserver-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-03 20:50:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Xiangyongluo",
"github_project": "exceltosqlserver",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "exceltosqlserver"
}