Repository: PyGithub/PyGithub

Issue:
NamedUser object is missing the twitter_username property
The `twitter_username` property is available via the Github v3 REST API, as documented here: https://developer.github.com/v3/users/#get-a-user. However, it isn't parsed from the response to `get_user()`, so (e.g.) `Github().get_user("jacquev6").twitter_username` raises an Attribute error.

It looks pretty straightforward to submit a fix, and I'd be happy to do so if there's interest. 


Discussion:

Resolving patch:
diff --git a/github/NamedUser.py b/github/NamedUser.py
--- a/github/NamedUser.py
+++ b/github/NamedUser.py
@@ -68,6 +68,14 @@ def node_id(self):
         self._completeIfNotSet(self._node_id)
         return self._node_id.value
 
+    @property
+    def twitter_username(self):
+        """
+        :type: string
+        """
+        self._completeIfNotSet(self._twitter_username)
+        return self._twitter_username.value
+
     def __hash__(self):
         return hash((self.id, self.login))
 
@@ -681,6 +689,7 @@ def _initAttributes(self):
         self._suspended_at = github.GithubObject.NotSet
         self._team_count = github.GithubObject.NotSet
         self._total_private_repos = github.GithubObject.NotSet
+        self._twitter_username = github.GithubObject.NotSet
         self._type = github.GithubObject.NotSet
         self._updated_at = github.GithubObject.NotSet
         self._url = github.GithubObject.NotSet
@@ -784,6 +793,10 @@ def _useAttributes(self, attributes):
             self._total_private_repos = self._makeIntAttribute(
                 attributes["total_private_repos"]
             )
+        if "twitter_username" in attributes:  # pragma no branch
+            self._twitter_username = self._makeStringAttribute(
+                attributes["twitter_username"]
+            )
         if "type" in attributes:  # pragma no branch
             self._type = self._makeStringAttribute(attributes["type"])
         if "updated_at" in attributes:  # pragma no branch


Test patch:
diff --git a/tests/NamedUser.py b/tests/NamedUser.py
--- a/tests/NamedUser.py
+++ b/tests/NamedUser.py
@@ -72,6 +72,7 @@ def testAttributesOfOtherUser(self):
         self.assertEqual(self.user.public_repos, 61)
         self.assertEqual(self.user.suspended_at, None)
         self.assertEqual(self.user.total_private_repos, None)
+        self.assertEqual(self.user.twitter_username, "nvie")
         self.assertEqual(self.user.type, "User")
         self.assertEqual(self.user.url, "https://api.github.com/users/nvie")
         self.assertEqual(self.user.node_id, "MDQ6VXNlcjgzODQ0")
@@ -110,6 +111,7 @@ def testAttributesOfSelf(self):
             self.user.suspended_at, datetime.datetime(2013, 8, 10, 7, 11, 7)
         )
         self.assertEqual(self.user.total_private_repos, 5)
+        self.assertIsNone(self.user.twitter_username)
         self.assertEqual(self.user.type, "User")
         self.assertEqual(self.user.url, "https://api.github.com/users/jacquev6")
         self.assertEqual(self.user.node_id, "MDQ6VXNlcjMyNzE0Ng==")
diff --git a/tests/ReplayData/NamedUser.testAttributesOfOtherUser.txt b/tests/ReplayData/NamedUser.testAttributesOfOtherUser.txt
--- a/tests/ReplayData/NamedUser.testAttributesOfOtherUser.txt
+++ b/tests/ReplayData/NamedUser.testAttributesOfOtherUser.txt
@@ -7,5 +7,5 @@ None
 None
 200
 [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '598'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"66a516a2007fb7df8bbb3f9cc7cb2da8"'), ('date', 'Fri, 18 May 2012 19:46:37 GMT'), ('content-type', 'application/json; charset=utf-8')]
-{"public_gists":16,"type":"User","hireable":false,"company":"3rd Cloud","url":"https://api.github.com/users/nvie","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","bio":null,"followers":296,"blog":"http://nvie.com","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"nvie","email":"vincent@3rdcloud.com","public_repos":61,"html_url":"https://github.com/nvie","name":"Vincent Driessen","created_at":"2009-05-12T21:19:38Z","location":"Netherlands","id":83844,"following":41,"node_id":"MDQ6VXNlcjgzODQ0"}
+{"public_gists":16,"type":"User","hireable":false,"company":"3rd Cloud","url":"https://api.github.com/users/nvie","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","bio":null,"followers":296,"blog":"http://nvie.com","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"nvie","email":"vincent@3rdcloud.com","public_repos":61,"html_url":"https://github.com/nvie","name":"Vincent Driessen","created_at":"2009-05-12T21:19:38Z","location":"Netherlands","id":83844,"following":41,"node_id":"MDQ6VXNlcjgzODQ0","twitter_username":"nvie"}