Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atao/csv2db
📋 Convert CSV to SQLite Database.
https://github.com/atao/csv2db
csv-parser python sqlite
Last synced: about 17 hours ago
JSON representation
📋 Convert CSV to SQLite Database.
- Host: GitHub
- URL: https://github.com/atao/csv2db
- Owner: atao
- License: mit
- Created: 2024-01-16T10:57:13.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-01-23T09:24:04.000Z (10 months ago)
- Last Synced: 2024-01-23T10:37:36.165Z (10 months ago)
- Topics: csv-parser, python, sqlite
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csv2db
📋 Convert CSV to SQLite Database.## Purpose
Easily transform a csv file into a SQLite database.
## Requirements
```
pip install -r requirements.txt
```## Usage and options
```
Usage: csv2db.py [OPTIONS]Options:
--version Show the version and exit.
-i, --csvfile TEXT CSV file [required]
-sep, --separator TEXT CSV field separator. [default: ;]
-chk, --chunksize INTEGER Number of rows per chunk to process. [default:
10000]
-d, --database TEXT Database name. [default: database.db]
-t, --table-name TEXT Table name. [default: data]
-idx, --include-index Include index in SQLite Database.
-v, --verbose Verbose mode.
-h, --help Show this message and exit.
```## Quickstart
Just run for example :
```
(.venv) ME > python .\csv2db.py -i .\adresses-31.csv -sep ";" -chk 10000 -d 31 -idx -v
```Output :
```
[+] Importing .\adresses-31.csv into SQLite database 31.db
[+] 10000 rows added to the database
[+] 10000 rows added to the database
...
[+] 10000 rows added to the database
[+] 5214 rows added to the database
[+] CSV data import process completed.
```