A convenient tool for transferring files between SQLite database and csv files and vice versa.
Project description
CSV-SQLite Converter
The CSV-SQLite Convert allows to store data both from SQLite database in csv files and from csv files in a SQLite database.
Installation
You can install CSV-SQLite Converter from PyPi (in the future).
python -m pip install csv_sqlite_converter
The converter supports Python 3.10 and higher.
How to use
The converter is a command line tool. To use it, run:
python -m csv_sqlite_converter
And the following should appear:
>>> Choose one of the following:
"db" to transfer data from a database to csv files
"csv" to transfer data from csv files to a database
"stop" to stop
>
where:
"db"
allows to transfer data from a database to csv files. It needs two paths: to the database and folder where csv files can be stored. After choosing this option the following appears:
>>> Copy path to database: <provide/here/path/to/database.db>
>>> Copy path to directory where folder with csv files will be stored: <provide/path/to/a/folder>
>>> Data from [name_of_table] table are now stored in [name_of_table].csv.
>>> Data from [name_of_another_table] table are now stored in [name_of_another_table].csv.
>>> ...
"csv"
allows to transfer data from csv files to a database. It needs two paths: to csv files with data and the database to write to. However, csv files must follow a very precise structure:
.
+-- csv1.csv
+-- csv2.csv
+-- csv3.csv
where:
- the name of the root folder matches the name of the database file
- names of csv files match names of tables in the database files (ex. students.csv holds data for a table named students)
After choosing this option the following appears:
>>> Copy path to database: <provide/here/path/to/database.db>
>>> Copy path to directory with csv files: <provide/path/to/a/folder/with/csv/files>
>>> File [name_of_csv_file] processed successfully.
>>> File [name_of_another_csv_file] processed successfully.
>>> ...
"stop"
stops the execution of the package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for csv-sqlite-converter-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab06e36596238c1c0e8deadc83d8c2c858c8c0eaefb2e1ad696e153ede75bd6 |
|
MD5 | 62883f3b0c14118f712f66a39ff974ad |
|
BLAKE2b-256 | bdcd2975095b2f108a99d1c15b963c74b4ceb3f0c8dc0fc08608b10aa120b691 |
Hashes for csv_sqlite_converter-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a12c44ebf341df1d64cfe2f76570be6c529fedb093e99a683c96bb2dd9d05f2 |
|
MD5 | 4128a77882bbf707e7c10553db25aa53 |
|
BLAKE2b-256 | 3b0a7660c27c3e3149a39395ac566488e2aeab0c7bf673581902d164ef0d9445 |