Metadata-Version: 2.1
Name: table2sql
Version: 1.0.1
Summary: 
Home-page: https://github.com/piotrgredowski/table2sql
License: MIT
Author: Piotr Gredowski
Author-email: piotrgredowski@gmail.com
Requires-Python: >=3.6.2,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: click (>=8.0.1,<9.0.0)
Requires-Dist: openpyxl (>=3.0.7,<4.0.0)
Project-URL: Bug Tracker, https://github.com/piotrgredowski/table2sql/issues
Description-Content-Type: text/markdown

# table2sql

[![CI](https://github.com/piotrgredowski/table2sql/actions/workflows/ci.yml/badge.svg)](https://github.com/piotrgredowski/table2sql/actions/workflows/ci.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=piotrgredowski_table2sql&metric=alert_status)](https://sonarcloud.io/dashboard?id=piotrgredowski_table2sql)
[![codecov](https://codecov.io/gh/piotrgredowski/table2sql/branch/main/graph/badge.svg?token=fNkIDyWLq7)](https://codecov.io/gh/piotrgredowski/table2sql)
[![CodeQL](https://github.com/piotrgredowski/table2sql/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/piotrgredowski/table2sql/actions/workflows/codeql-analysis.yml)

Python CLI tool which allows you to convert file with table (CSV and Excel) to SQL insert statements.

[Docs](https://gredowski.com/table2sql/)

## Basic usage

`some.csv`

```csv
a,b,c,d
int,str,float,sql
1,2,3,(SELECT id FROM another.table WHERE name = 'Paul')
5,6,7,(SELECT id FROM another.table WHERE name = 'Paul')
```

Command:

```bash
table2sql some.csv --output-table some.table --has-types-row
```

Result:

```sql
INSERT INTO some.table (a, b, c, d)
VALUES (1, '2', 3.0, (SELECT id FROM another.table WHERE name = 'Paul')), (5, '6', 7.0, (SELECT id FROM another.table WHERE name = 'Paul'));
```

## Install

```bash
pip install table2sql
```

