# Introduction
This package help to convert your excel files (xlsx,xls,csv) to MySQL Server database.
# Installation
exceltomysql can be installed as:
Windows:
```python
pip install exceltomysql
```
# Dependency
👍 [pandas](https://pandas.pydata.org/)
👍 [pymysql](http://www.pymssql.org/)
👍 [sqlalchemy](https://www.sqlalchemy.org/)
# QuickStart
```python
from exceltomysql import ExcelToDB
# Step 1, prepare your input pareameters
yourFile = "test01.xls" # available for xlsx, xls,csv
yourUsrID = ""
yourPWD = ""
yourDBname= ""
rename_table = "" # Use your filename as tablename to MySQL Server or user define their prefered table name. e.g. : "test"
# get your local host name
# this will return your local computer name for your MySQL server database
host_name = em.hostname
# get your local ip address
# this will return your local ip address (if your sql server can be accessed by DNS)
IP = em.local_ip
yourHostOrIP = "localhost" # you need to change your host if needed, dns: local ip address
# Step 2, save your data onto MySQL
ex = ExcelToDB(yourFile, yourHoseOrIP, yourUsrID, yourPWD, yourDBname, rename_table)
ex.save2db()
```
```python
output:
Successfully load excel data...
Secessfully connected to MySQL Server...
Secessfully saved 'yourtable' to MySQL Server...
```
# API Reference
exceltomysql.ExcelToDB(`filePath, host_ip ="", usrID = "", pwd = "", db_name = "", rename_table = ""`)
filePath: str
hostORip: str default :""
usrID: str default: ""
pwd: str default: ""
db_name: str default: ""
rename_table: str default: "", will auto save your filename as tablename to MySQL Database. If assignmed value, will change tablename from your filename to the assigned value.
Raw data
{
"_id": null,
"home_page": "https://github.com/Xiangyongluo/exceltomysql",
"name": "exceltomysql",
"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/41/f0/798f64c0f62f0587b85604a35d8f24a2be0491b21d838725244ef83555b7/exceltomysql-0.2.3.tar.gz",
"platform": null,
"description": "# Introduction\r\n\r\nThis package help to convert your excel files (xlsx,xls,csv) to MySQL Server database.\r\n\r\n# Installation\r\n\r\nexceltomysql can be installed as:\r\n\r\nWindows:\r\n\r\n```python\r\npip install exceltomysql\r\n```\r\n\r\n# Dependency\r\n\r\n\ud83d\udc4d [pandas](https://pandas.pydata.org/)\r\n\r\n\ud83d\udc4d [pymysql](http://www.pymssql.org/)\r\n\r\n\ud83d\udc4d [sqlalchemy](https://www.sqlalchemy.org/)\r\n\r\n# QuickStart\r\n\r\n```python\r\nfrom exceltomysql import ExcelToDB\r\n\r\n# Step 1, 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 to MySQL Server or user define their prefered 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 MySQL server database\r\nhost_name = em.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 = em.local_ip\r\nyourHostOrIP = \"localhost\" # you need to change your host if needed, dns: local ip address\r\n\r\n# Step 2, save your data onto MySQL\r\nex = ExcelToDB(yourFile, yourHoseOrIP, yourUsrID, yourPWD, yourDBname, rename_table)\r\nex.save2db()\r\n\r\n```\r\n\r\n\r\n```python\r\noutput:\r\nSuccessfully load excel data...\r\nSecessfully connected to MySQL Server...\r\nSecessfully saved 'yourtable' to MySQL Server...\r\n```\r\n\r\n# API Reference\r\n\r\nexceltomysql.ExcelToDB(`filePath, host_ip =\"\", usrID = \"\", pwd = \"\", db_name = \"\", rename_table = \"\"`)\r\n\r\nfilePath: str\r\n\r\nhostORip: 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 tablename to MySQL Database. If assignmed value, will change tablename 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 MySQL Database.",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://github.com/Xiangyongluo/exceltomysql"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f7ed0a78b498fa44f69eb5a53982e65f6071cc1c446761b611df8b5914d14cb0",
"md5": "41677230e476a564022ec0daa8dfadf2",
"sha256": "360225aaf53193ff37c0ff4c5e48bd4a375b0b6b038d78beb8adcbb3035efff0"
},
"downloads": -1,
"filename": "exceltomysql-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "41677230e476a564022ec0daa8dfadf2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 4581,
"upload_time": "2024-03-03T19:46:09",
"upload_time_iso_8601": "2024-03-03T19:46:09.054755Z",
"url": "https://files.pythonhosted.org/packages/f7/ed/0a78b498fa44f69eb5a53982e65f6071cc1c446761b611df8b5914d14cb0/exceltomysql-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41f0798f64c0f62f0587b85604a35d8f24a2be0491b21d838725244ef83555b7",
"md5": "5a5f8de8e518c59e640a8e1ab42d74cc",
"sha256": "33ecb62abf87e331cbaa2641ddbec12bad6a6c453702ff29762e38b5944c1a41"
},
"downloads": -1,
"filename": "exceltomysql-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "5a5f8de8e518c59e640a8e1ab42d74cc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 4578,
"upload_time": "2024-03-03T19:46:10",
"upload_time_iso_8601": "2024-03-03T19:46:10.858136Z",
"url": "https://files.pythonhosted.org/packages/41/f0/798f64c0f62f0587b85604a35d8f24a2be0491b21d838725244ef83555b7/exceltomysql-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-03 19:46:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Xiangyongluo",
"github_project": "exceltomysql",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "exceltomysql"
}