title: Convert raw string to JSON object in python2.7
body: <p>I am querying a PostgreSQL server to get data and a particular <code>json</code> object actually gets returned as a string. I tried following but its not giving the correct output: (It's <code>ipython</code> outputs)</p>
  
  <pre><code>test
  Out[103]: '{"max"=&gt;28, "min"=&gt;18, "custom"=&gt;[{"id"=&gt;"12345","name"=&gt;"test_pur"}]}'
  In[104]: test.replace("=&gt;",":")
  Out[104]: '{"max":28, "min":18, "custom":[{"id":"12345", "name":"test_pur"}]}'
  In[105]: j_obj = json.dumps(test)
  In[106]: j_obj
  Out[106]: '"{\\"max\\"=&gt;28, \\"min\\"=&gt;18, \\"custom\\"=&gt;[{\\"id\\"=&gt;\\"12345\\", \\"name\\"=&gt;\\"test_pur\\"}]}"'
  </code></pre>
  
  <p>How can i convert a string to json by recognizing the ":" symbol?</p>
  
  <p>When i am trying "json.loads" . Following are the errors: </p>
  
  <pre><code>Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/IPython/core/interactiveshell.py", line 3035, in run_code
      exec(code_obj, self.user_global_ns, self.user_ns)
    File "&lt;ipython-input-12-a7562191decf&gt;", line 1, in &lt;module&gt;
      data = json.loads(temp)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
      return _default_decoder.decode(s)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 381, in raw_decode
      obj, end = self.scan_once(s, idx)
  ValueError: Expecting : delimiter: line 1 column 11 (char 10)
  </code></pre>