So... I started educating myself about Script and how raw blocks and transactions are stored recently, and I wrote a few python functions that I thought could be useful to me later (mostly reinventing the wheel to learn about wheels...)
Anyway, I ended up making
this and I thought it could be useful to others, so I'm posting it here. It contains a dict of Script opcodes, a jsonrpcserver class, a pure python function similar to bitcoind's decoderawtransaction, and a few other things.
The last part is an HTTP server that uses these functions to mimic blockexplorer.
blockexplorer.com/rawtx/ --> localhost:8334/rawtx/
blockexplorer.com/rawblock/ --> localhost:8334/rawblock/
blockexplorer.com/q/getblockcount --> localhost:8334/getblockcount
blockexplorer.com/q/getblockhash/ --> localhost:8334/getblockhash/
I tested bxgetblock against blocks 1->100000 and blocks 199000-> 203198 on blockexplorer to weed out any bugs, so it's a safe assumption that they have the same outputs.
(Don't forget to change the rpc password in line 311 to the one in your bitcoin.conf file before running.)