I'm newbie in python + scrapy + alembic. I finding a way to insert some init data in alembic using bulk_insert function.
my code: (direct insert)
op.bulk_insert('table',
[
{
'id' : 1,
'website': 'http://example',
'xpath_pagination': '',
'xpath_product': '',
},
{
'id' : 1,
'website': 'http://example',
'xpath_pagination': '',
'xpath_product': '',
},
{
'id' : 1,
'website': 'http://example',
'xpath_pagination': '',
'xpath_product': '',
},
])
And now, I want to change way insert from out site
hope code:
import initdata
...
op.bulk_insert('table', initdata.data)
My quesion: how to do this right way? (type file using in this case). How to insert module initdata.
Thanks