'Is it possible to run pgRouting functions pgr_nodeNetwork and pgr_createTopology from Python to create topology in PostgreSQL?

I successfully created a series of queries using PostgreSQL's great extension pgRouting. Now I'm trying to set up a python script to run the whole process from python. I connected to the PostgreSQL database using sqlalchemy library. All queries are working well except pgr_nodeNetwork and pgr_createTopology which are pgRouting functions. When I run the python script, it successfully finishes and gives all messages, exactly the same as PostgreSQL does. pgr_nodeNetwork should create a new table but it's not created. Is there any different way to make these two functions work?

Update: I noted that in pgAdmin dashboard for this transaction state is "idle in transaction"



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source