Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jerryfzhang/exceltosql

Excel to SQL insertion code generator.
https://github.com/jerryfzhang/exceltosql

csv csv-converter csv-import csv-parser insertion sql sql-insert xls

Last synced: 17 days ago
JSON representation

Excel to SQL insertion code generator.

Awesome Lists containing this project

README

        

# ExcelToSQL
This a program written in python that take an xls file as a input, generate csv code for each sheet stored, and generate SQL insertion code for a quick databse testing.
Some of the cool features including

- checking if the file exist or not and then create or wipe the file if necessary
- check the datatype and parse string and int differently

# How to use
- There are three ways to download the file:
1. Download the repo as a zip.
2. Download the run.py file only.
3. Or clone the repo by typing the following command into your terminal:

```
git clone https://github.com/zhang96/ExcelToSQL
```
Install the require modules including:

- xlrd
- pandas

Put the spreadsheet file in the folder and name it as data.xls, make sure it ends with .xls not .xlsx.

- There are two ways to run the file:
1. Run the file IDLE or other IDEs.
2. Set the directory in the terminal and then type the following command into the terminal
```
python run.py
```
#Todo
- Add inline comments
- Code logic optimization
- Support for *.xlsx files insted of only *.xls files.
- Support for other datetypes other thah int and string.
- Eliminate csv intermidiated generation.
- Option to generate all insertion into a single *.sql file.

#Author
zhang96

#License
MIT, see LICENSE.txt.