I\'m running the following code:
asset = {} asset[\'abc\'] = \'def\' print type(asset) print asset[\'abc\'] query = \'{\"abc\": \"{abc}\"}\'.format(abc=asset
wrap the outer braces in braces:
query = '{{"abc": "{abc}"}}'.format(abc=asset['abc']) print query {"abc": "def"}