Python wrapper for Block code