I am using a function to migrate data between mongo and oracle. This function takes as input 3 arguments: the connection to mongo, the connection to oracle and the entity of the mongo database which I am using as key in mongo. I am looping through a list of entities so the code looks as this one:
def move_data( engine, mongo_conn, entity ):
# do stuff here
# Create a pandas df
df.to_sql( ... )
if __name__ == “__main__”:
for entity in entity_list:
move_data( engine, mongo_conn, entity )
Is there a way to parallelize this for loop? It is not possible for me to use python3 for this task.