exceltopostgresql-0.0.9
توضیحات
This package help to convert your excel files (xlsx,xls,csv) to Postgresql database.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | exceltopostgresql-0.0.9 |
| نام | exceltopostgresql |
| نسخه کتابخانه | 0.0.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Xiangyong Luo |
| ایمیل نویسنده | rochemay@163.com |
| آدرس صفحه اصلی | https://github.com/Xiangyongluo/exceltopostgresql |
| آدرس اینترنتی | https://pypi.org/project/exceltopostgresql/ |
| مجوز | - |
# Introduction
This package help to convert your excel files (xlsx,xls,csv) to postgresql database.
# Installation
exceltopostgresql can be installed as:
```python
pip install exceltopostgresql
```
# Dependency
👍 [pandas](https://pandas.pydata.org/)
👍 [psycopg2](https://pypi.org/project/psycopg2/)
👍 [sqlalchemy](https://www.sqlalchemy.org/)
# QuickStart
```python
import exceltosqlserver as ep
# generate the class instance
# STEP One, prepare your input pareameters
yourFile = "test01.xls" # available for xlsx, xls,csv
yourUsrID = ""
yourPWD = ""
yourDBname= ""
save2tableName = False
# False: 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 convert your data to sql server
ep.exceltoDBtable(yourFile,yourHostORip,yourUsrID,yourPWD,yourDBname,save2tableName)
```
```python
output:
Successfully load excel data...
Secessfully connected to SQL Server...
Secessfully saved 'yourtable' onto Posggresql...
```
# API Reference
exceltopostgresql.exceltoDBtable(`filePath,host_ip=False,usrID =False,pwd=False,database_name=False,port:str= "5432",save2tableName=False`)
```
Args:
filePath (str): [path of your input file name]
host_ip (bool, optional): [description]. Defaults to False.
usrID (bool, optional): [description]. Defaults to False.
pwd (bool, optional): [description]. Defaults to False.
database_name (bool, optional): [description]. Defaults to False.
port (str, optional): [description]. Defaults to "5432".
save2tableName (bool, optional): [description]. Defaults to False.
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl exceltopostgresql-0.0.9:
pip install exceltopostgresql-0.0.9.whl
نصب پکیج tar.gz exceltopostgresql-0.0.9:
pip install exceltopostgresql-0.0.9.tar.gz