"offline" blockchain querying library
You should take a look at Abe:

Abe: a free block chain browser for Bitcoin-based currencies.

Abe reads the Bitcoin block file, transforms and loads the data into a database, and presents a web interface similar to Bitcoin Block Explorer or Blockchain.io.

Not to mention it was written in Python.