Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imvickykumar999/csv2sqltable
MySQL Hosted @ https://cloud.seenode.com/dashboard/databases#connection
https://github.com/imvickykumar999/csv2sqltable
csv2sql database mysql
Last synced: 26 days ago
JSON representation
MySQL Hosted @ https://cloud.seenode.com/dashboard/databases#connection
- Host: GitHub
- URL: https://github.com/imvickykumar999/csv2sqltable
- Owner: imvickykumar999
- Created: 2023-06-26T07:30:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-03T08:16:30.000Z (about 1 year ago)
- Last Synced: 2023-10-03T17:21:59.662Z (about 1 year ago)
- Topics: csv2sql, database, mysql
- Language: Jupyter Notebook
- Homepage: https://colab.research.google.com/drive/1ZYzsbmTLhgcrxRINs-8puznOOTdW8BbM?usp=sharing
- Size: 300 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `Python Package` : [`csv2sqltable`](https://pypi.org/project/csv2sqltable/)
!pip install csv2sqltable -U
![image](https://github.com/imvickykumar999/csv2sqltable/assets/50515418/d10799b2-875d-46ff-81f6-565771f6c44f)
-----------
`Input` : `customer.csv`
------customer_id | customername | lastname | country | age | phone
----------- | ------------ | -------- | ------- | --- | -----
1 | Shubham | Thakur | India | 23 | xxxxxxxxxx
2 | Aman | Chopra | Australia | 21 | xxxxxxxxxx
3 | Naveen | Tulasi | "Sri Lanka" | 24 | xxxxxxxxxx
4 | Aditya | Arpan | Austria | 21 | xxxxxxxxxx
5 | "Nishant. Salchichas S.A." | Jain | Spain | 22 | xxxxxxxxxx--------
`Code` : `run in google colab`
-----import csv2sqltable.convert as c2s
print(c2s.transform('customer.csv'))------------
`Output` : `copy and paste in cell`
-------!pip install "SQLAlchemy<1.4"
%reload_ext sql
%%sql sqlite:///vicks.db
%%sql
-- DROP TABLE customer;
CREATE TABLE customer (
customer_id VARCHAR(100),
customername VARCHAR(100),
lastname VARCHAR(100),
country VARCHAR(100),
age VARCHAR(100),
phone VARCHAR(100)
);
INSERT INTO customer (customer_id, customername, lastname, country, age, phone)
VALUES
('1', 'Shubham', 'Thakur', 'India', '23', 'xxxxxxxxxx'),
('2', 'Aman', 'Chopra', 'Australia', '21', 'xxxxxxxxxx'),
('3', 'Naveen', 'Tulasi', 'Sri Lanka', '24', 'xxxxxxxxxx'),
('4', 'Aditya', 'Arpan', 'Austria', '21', 'xxxxxxxxxx'),
('5', 'Nishant. Salchichas S.A.', 'Jain', 'Spain', '22', 'xxxxxxxxxx');
SELECT * FROM customer;------------
`Sub Output` : `on running magic sql command`
-----------