https://github.com/vanvuvuong/to_sql
Little tool to convert the CSV, XML file to SQL
https://github.com/vanvuvuong/to_sql
csv docker sql xml
Last synced: 2 months ago
JSON representation
Little tool to convert the CSV, XML file to SQL
- Host: GitHub
- URL: https://github.com/vanvuvuong/to_sql
- Owner: vanvuvuong
- Created: 2021-08-14T09:43:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T08:56:52.000Z (almost 4 years ago)
- Last Synced: 2023-03-04T05:22:59.010Z (about 3 years ago)
- Topics: csv, docker, sql, xml
- Language: Python
- Homepage: https://vanvuvuong.github.io/to_sql/
- Size: 2.72 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CSV, XML TO SQL VERSION 0.1.1
===
## SETUP THE ENVIRONMENT (GUIDE FOR LINUX ONLY)
Requirement:
---
- Docker & docker-compose. Please view the official documentations to install it: https://docs.docker.com/get-docker/
- Create the `.env` & `to_sql/config/config.yaml` files
- Know how to use `docker` & `docker-composer`
---
### Start the docker-compose:
---
```
docker-compose up -d
```
### Start the docker-compose & rebuild the image:
---
```
docker-compose up --build -d
```
### Stop the docker-compose:
---
```
docker-compose down
```
## GUIDE TO USE THE SCRIPT (Keep the `container` alive to run the script)
---
1. Let get into the container:
```
docker container exec -it app /bin/bash
```
2. Run this script to see command and option:
```
py main.py --help
```
3. Copy the files to folder `files` to get them ready to run
4. Example of running:
- Importing 1 csv file sample
```
py main.py csv files/sample.csv
```
- Importing 2 csv files sample
```
py main.py csv files/sample.csv files/customers.csv
```
After run the scrip, the terminal will ask you to type the `encoding`, `delimiter` and `quotechar` of the csv files. The default values of them have been set.
- Importing 1 xml file sample
```
py main.py xml files/sample.xml
```
- Importing 2 xml files sample
```
py main.py xml files/sample.xml files/products.xml
```
After run the scrip, the terminal will ask you to type the `encoding`, `parse_type` of the xml files. The default values of them have been set.