From 3fe9edf08707d2c289d4e6a05f7521751cf9f8e4 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 4 Sep 2013 23:28:44 +0200 Subject: [PATCH] Implement object persistence This follows my proposal for #193. Largely inspired by AKFish's work. --- github/GithubObject.py | 52 +++--------------- github/MainClass.py | 26 ++++++++- github/tests/AllTests.py | 1 + github/tests/Persistence.py | 54 +++++++++++++++++++ github/tests/ReplayData/Persistence.setUp.txt | 11 ++++ .../Persistence.testLoadAndUpdate.txt | 11 ++++ 6 files changed, 110 insertions(+), 45 deletions(-) create mode 100644 github/tests/Persistence.py create mode 100644 github/tests/ReplayData/Persistence.setUp.txt create mode 100644 github/tests/ReplayData/Persistence.testLoadAndUpdate.txt diff --git a/github/GithubObject.py b/github/GithubObject.py index 5f4a979c..c2ae7f6d 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -24,10 +24,7 @@ # # ################################################################################ -from __future__ import with_statement - import datetime -import pickle import GithubException import Consts @@ -78,6 +75,14 @@ class GithubObject(object): self._completeIfNeeded() return self._rawData + @property + def raw_headers(self): + """ + :type: dict + """ + self._completeIfNeeded() + return self._headers + @staticmethod def _parentUrl(url): return "/".join(url.split("/")[: -1]) @@ -100,47 +105,6 @@ class GithubObject(object): else: return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%SZ") - # #193: I temporarily comment out those two methods - # We need to address the following: - # - The interface should use file-like objects (not file names) - # - it's more "pythonic" - # - it allows user to save several objects in the same physical file - # - it's easier to unit-test because we can inject in-memory file-like objects - # - We should not save identification information - # - We should not re-create several instances of Requester when loading objects - # - This would lead to very surprising behaviors, when changing Github.per_page or anything impacting this central part of PyGithub - # - It should be possible to restore a saved object without knowing its previous type - # - The "load" method should not make the user think she must know this previous type - # - In particular, it shouldn't be a classmethod of GithubObject - # - They should be covered by unit tests - # - # My proposal, to be experimented and discussed: - # - in "save", pickle a tuple containing the class of the object, its rawData and its headers - # - make "load" a method of class Github - # - it will unpickle everything and call Github.create_from_raw_data - # - I would even make "save" a method of Github, to keep it symetric with "load" - # - # Using __get_state__ would not be enought because we wouldn't have access - # to the Requester instance in __set_state__. - - # def save(self, file_name): - # ''' - # Save instance to a file - # :param file_name: the full path of target file - # ''' - # with open(file_name, 'wb') as f: - # pickle.dump(self, f) - - # @classmethod - # def load(cls, file_name): - # ''' - # Load saved instance from file - # :param file_name: the full path to saved file - # :rtype: saved instance. The type of loaded instance remains its orginal one and will not be affected by from which derived class the method is called. - # ''' - # with open(file_name, 'rb') as f: - # return pickle.load(f) - @property def etag(self): ''' diff --git a/github/MainClass.py b/github/MainClass.py index 4eab8517..3efde171 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -26,6 +26,7 @@ ################################################################################ import urllib +import pickle from Requester import Requester import AuthenticatedUser @@ -366,10 +367,33 @@ class Github(object): def create_from_raw_data(self, klass, raw_data, headers={}): """ - Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data` + Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data`, + and optionaly headers previously obtained by :attr:`github.GithubObject.GithubObject.raw_headers`. :param klass: the class of the object to create :param raw_data: dict + :param headers: dict :rtype: instance of class ``klass`` """ return klass(self.__requester, headers, raw_data, completed=True) + + def dump(self, obj, file, protocol=0): + """ + Dumps (pickles) a PyGithub object to a file-like object. + Some effort is made to not pickle sensitive informations like the Github credentials used in the :class:`Github` instance. + But NO EFFORT is made to remove sensitive information from the object's attributes. + + :param obj: the object to pickle + :param file: the file-like object to pickle to + :param protocol: the `pickling protocol `_ + """ + pickle.dump((obj.__class__, obj.raw_data, obj.raw_headers), file, protocol) + + def load(self, f): + """ + Loads (unpickles) a PyGithub object from a file-like object. + + :param f: the file-like object to unpickle from + :return: the unpickled object + """ + return self.create_from_raw_data(*pickle.load(f)) diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index 53789e0f..5c2ce6da 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -81,3 +81,4 @@ from Issue158 import * from Issue174 import * from ConditionalRequestUpdate import ConditionalRequestUpdate +from Persistence import Persistence diff --git a/github/tests/Persistence.py b/github/tests/Persistence.py new file mode 100644 index 00000000..deb52e70 --- /dev/null +++ b/github/tests/Persistence.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +############################ Copyrights and license ############################ +# # +# Copyright 2013 Vincent Jacques # +# # +# This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import Framework +import github + +if Framework.atLeastPython26: + from io import BytesIO as IO +else: + from StringIO import StringIO as IO + +class Persistence(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_repo("akfish/PyGithub") + + self.dumpedRepo = IO() + self.g.dump(self.repo, self.dumpedRepo) + self.dumpedRepo.seek(0) + + def tearDown(self): + self.dumpedRepo.close() + + def testLoad(self): + loadedRepo = self.g.load(self.dumpedRepo) + self.assertIsInstance(loadedRepo, github.Repository.Repository) + self.assertIs(loadedRepo._requester, self.repo._requester) + self.assertIs(loadedRepo.owner._requester, self.repo._requester) + self.assertEqual(loadedRepo.name, "PyGithub") + self.assertEqual(loadedRepo.url, "https://api.github.com/repos/akfish/PyGithub") + + def testLoadAndUpdate(self): + loadedRepo = self.g.load(self.dumpedRepo) + self.assertTrue(loadedRepo.update()) diff --git a/github/tests/ReplayData/Persistence.setUp.txt b/github/tests/ReplayData/Persistence.setUp.txt new file mode 100644 index 00000000..dfc62ba2 --- /dev/null +++ b/github/tests/ReplayData/Persistence.setUp.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/repos/akfish/PyGithub +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '13698'), ('server', 'GitHub.com'), ('last-modified', 'Thu, 22 Aug 2013 02:09:11 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"8600bedcb7fed1d8065e1693e05529ce"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Thu, 22 Aug 2013 02:13:08 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1377140429')] +{"id":12156762,"name":"PyGithub","full_name":"akfish/PyGithub","owner":{"login":"akfish","id":922715,"avatar_url":"https://1.gravatar.com/avatar/12a1b44d4e5c19cee59618084602b112?d=https%3A%2F%2Fidenticons.github.com%2F6eb90fb68a77fb5a5a997c6264bedf35.png","gravatar_id":"12a1b44d4e5c19cee59618084602b112","url":"https://api.github.com/users/akfish","html_url":"https://github.com/akfish","followers_url":"https://api.github.com/users/akfish/followers","following_url":"https://api.github.com/users/akfish/following{/other_user}","gists_url":"https://api.github.com/users/akfish/gists{/gist_id}","starred_url":"https://api.github.com/users/akfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akfish/subscriptions","organizations_url":"https://api.github.com/users/akfish/orgs","repos_url":"https://api.github.com/users/akfish/repos","events_url":"https://api.github.com/users/akfish/events{/privacy}","received_events_url":"https://api.github.com/users/akfish/received_events","type":"User"},"private":false,"html_url":"https://github.com/akfish/PyGithub","description":"Python library implementing the full Github API v3","fork":true,"url":"https://api.github.com/repos/akfish/PyGithub","forks_url":"https://api.github.com/repos/akfish/PyGithub/forks","keys_url":"https://api.github.com/repos/akfish/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akfish/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akfish/PyGithub/teams","hooks_url":"https://api.github.com/repos/akfish/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/akfish/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/akfish/PyGithub/events","assignees_url":"https://api.github.com/repos/akfish/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/akfish/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/akfish/PyGithub/tags","blobs_url":"https://api.github.com/repos/akfish/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akfish/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akfish/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/akfish/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akfish/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/akfish/PyGithub/languages","stargazers_url":"https://api.github.com/repos/akfish/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/akfish/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/akfish/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/akfish/PyGithub/subscription","commits_url":"https://api.github.com/repos/akfish/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/akfish/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/akfish/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/akfish/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/akfish/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/akfish/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akfish/PyGithub/merges","archive_url":"https://api.github.com/repos/akfish/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akfish/PyGithub/downloads","issues_url":"https://api.github.com/repos/akfish/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/akfish/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/akfish/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/akfish/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akfish/PyGithub/labels{/name}","created_at":"2013-08-16T10:56:11Z","updated_at":"2013-08-22T02:09:11Z","pushed_at":"2013-08-22T02:09:09Z","git_url":"git://github.com/akfish/PyGithub.git","ssh_url":"git@github.com:akfish/PyGithub.git","clone_url":"https://github.com/akfish/PyGithub.git","svn_url":"https://github.com/akfish/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":6736,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"master_branch":"master","default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"network_count":70,"parent":{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User"},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-08-21T20:32:08Z","pushed_at":"2013-08-21T20:31:45Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":7437,"watchers_count":248,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":70,"mirror_url":null,"open_issues_count":17,"forks":70,"open_issues":17,"watchers":248,"master_branch":"master","default_branch":"master"},"source":{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User"},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-08-21T20:32:08Z","pushed_at":"2013-08-21T20:31:45Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":7437,"watchers_count":248,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":70,"mirror_url":null,"open_issues_count":17,"forks":70,"open_issues":17,"watchers":248,"master_branch":"master","default_branch":"master"}} + diff --git a/github/tests/ReplayData/Persistence.testLoadAndUpdate.txt b/github/tests/ReplayData/Persistence.testLoadAndUpdate.txt new file mode 100644 index 00000000..b6d8aeec --- /dev/null +++ b/github/tests/ReplayData/Persistence.testLoadAndUpdate.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/repos/akfish/PyGithub +{'If-None-Match': '"8600bedcb7fed1d8065e1693e05529ce"', 'User-Agent': 'PyGithub/Python', 'Authorization': 'Basic login_and_password_removed', 'If-Modified-Since': 'Thu, 22 Aug 2013 02:09:11 GMT'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '13712'), ('server', 'GitHub.com'), ('last-modified', 'Thu, 22 Aug 2013 02:14:54 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"ef281ef0e821c18f80da36902727160b"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Thu, 22 Aug 2013 02:15:01 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1377140429')] +{"id":12156762,"name":"PyGithub","full_name":"akfish/PyGithub","owner":{"login":"akfish","id":922715,"avatar_url":"https://0.gravatar.com/avatar/12a1b44d4e5c19cee59618084602b112?d=https%3A%2F%2Fidenticons.github.com%2F6eb90fb68a77fb5a5a997c6264bedf35.png","gravatar_id":"12a1b44d4e5c19cee59618084602b112","url":"https://api.github.com/users/akfish","html_url":"https://github.com/akfish","followers_url":"https://api.github.com/users/akfish/followers","following_url":"https://api.github.com/users/akfish/following{/other_user}","gists_url":"https://api.github.com/users/akfish/gists{/gist_id}","starred_url":"https://api.github.com/users/akfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akfish/subscriptions","organizations_url":"https://api.github.com/users/akfish/orgs","repos_url":"https://api.github.com/users/akfish/repos","events_url":"https://api.github.com/users/akfish/events{/privacy}","received_events_url":"https://api.github.com/users/akfish/received_events","type":"User"},"private":false,"html_url":"https://github.com/akfish/PyGithub","description":"Python library implementing the full Github API v3 - AKFish Fork","fork":true,"url":"https://api.github.com/repos/akfish/PyGithub","forks_url":"https://api.github.com/repos/akfish/PyGithub/forks","keys_url":"https://api.github.com/repos/akfish/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akfish/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akfish/PyGithub/teams","hooks_url":"https://api.github.com/repos/akfish/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/akfish/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/akfish/PyGithub/events","assignees_url":"https://api.github.com/repos/akfish/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/akfish/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/akfish/PyGithub/tags","blobs_url":"https://api.github.com/repos/akfish/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akfish/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akfish/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/akfish/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akfish/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/akfish/PyGithub/languages","stargazers_url":"https://api.github.com/repos/akfish/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/akfish/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/akfish/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/akfish/PyGithub/subscription","commits_url":"https://api.github.com/repos/akfish/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/akfish/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/akfish/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/akfish/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/akfish/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/akfish/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akfish/PyGithub/merges","archive_url":"https://api.github.com/repos/akfish/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akfish/PyGithub/downloads","issues_url":"https://api.github.com/repos/akfish/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/akfish/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/akfish/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/akfish/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akfish/PyGithub/labels{/name}","created_at":"2013-08-16T10:56:11Z","updated_at":"2013-08-22T02:14:54Z","pushed_at":"2013-08-22T02:09:09Z","git_url":"git://github.com/akfish/PyGithub.git","ssh_url":"git@github.com:akfish/PyGithub.git","clone_url":"https://github.com/akfish/PyGithub.git","svn_url":"https://github.com/akfish/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":6736,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"master_branch":"master","default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"network_count":70,"parent":{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User"},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-08-21T20:32:08Z","pushed_at":"2013-08-21T20:31:45Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":7437,"watchers_count":248,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":70,"mirror_url":null,"open_issues_count":17,"forks":70,"open_issues":17,"watchers":248,"master_branch":"master","default_branch":"master"},"source":{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User"},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-08-21T20:32:08Z","pushed_at":"2013-08-21T20:31:45Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":7437,"watchers_count":248,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":70,"mirror_url":null,"open_issues_count":17,"forks":70,"open_issues":17,"watchers":248,"master_branch":"master","default_branch":"master"}} +