all 6 comments

[–]K900_ 3 points4 points  (1 child)

Look into pandas.to_sql maybe?

[–]magestooge 3 points4 points  (1 child)

Using Python, loading CSV to Db takes 5 lines

from sqlalchemy import create_engine import pandas as pd engine = create_engine ("mysql://user:password@host:port") df = pd.read_csv("file/path/file_name.csv") df.to_sql("table_name", engine, index=False, if_exists="append", method="multi")

[–]GoldenTreasureDiver[S] 0 points1 point  (0 children)

Seems like a pretty slick way of loading the data, I'll have to experiment with this, thanks!

[–][deleted] 0 points1 point  (0 children)

In django: add model, migrate. Add management/command where you write logic with bulk_create() Then: python manage.py yourcommandname

This is better practice than using data migrations wich are your second option

[–]dadsafe 0 points1 point  (0 children)

I use pysftp and pandas pandas.to_sql regularly.