you can just use dumps and loads, then you don't need the ``StringIO``.