Skip to content

Instantly share code, notes, and snippets.

@dazza-codes
Created December 6, 2022 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dazza-codes/16ee59269a030d01e9c16b6036b24ccc to your computer and use it in GitHub Desktop.
Save dazza-codes/16ee59269a030d01e9c16b6036b24ccc to your computer and use it in GitHub Desktop.
Pandas CSV to SQL
#!/usr/bin/env python
import pandas as pd
from sqlalchemy import create_engine
engine = create_engine('sqlite://', echo=True)
df = pd.read_csv("/tmp/input.csv")
df.to_sql('input', con=engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment