Prolog in Python (pt. 1)

I’ve recently become enamored with the idea of querying a Prolog program with a MySQL database backend from a Python script. Specifically I want to create a Django web app that will allow a user to ask for the price of a thing in terms of anything else. Prolog seems like an excellent choice for the value-finding engine as value-finding in this case will mostly consist of finding a path of trade between two things. For example, in order to find the price of apples in terms of bananas, the value finding engine will first query its database to see if it already knows that off-hand. If it doesn’t, it then has to see what it does know about the price of apples and then see if anything it can trade apples for can then be traded for bananas. It has to keep branching out until it finally hits bananas.