title: Pymongo - how to get status as a python dictionary for rep sets
body: <p>I am new to mongo and I am using pymongo. I am finding the documentation for pymongo to be all over the place.  </p>
  
  <p>1) I have a rep set. From the mongo shell, if I run the below I get what I need.</p>
  
  <pre><code>sudo mongo 111.111.111.111 --eval "printjson(rs.status())"
  MongoDB shell version: 2.2.1
  connecting to: 111.111.111.111/test
  {
      "set" : "hey",
      "date" : ISODate("2012-11-10T11:47:58Z"),
      "myState" : 1,
      "members" : [
          {
              "_id" : 0,
              "name" : "111.111.111.111:27017",
              "health" : 1,
              "state" : 1,
              "stateStr" : "PRIMARY",
              "uptime" : 69189,
              "optime" : Timestamp(1352478921000, 1),
              "optimeDate" : ISODate("2012-11-09T16:35:21Z"),
              "self" : true
          }
      ],
      "ok" : 1
  }
  </code></pre>
  
  <p>I need to get that info from pymongo.</p>
  
  <p>1) I connect to the primary. I get <code>none</code> but per the above that node is primary:</p>
  
  <pre><code>c = ReplicaSetConnection("111.111.111.111:27017", replicaSet='heythat')
  print c.primary
  None
  </code></pre>
  
  <p>2) I want to run <code>c.command("status")</code> but that operation is not supported. </p>
  
  <p>So, how to I use pymongo to return the primary and also to return status as a Python dictionary?</p>