Datalog logic programming in python