I'd like to be able to serialize a GithubObject and get back the original JSON that was used to initially construct it for purposes of serializing out to a document oriented store like MongoDB where this representation would be a natural (and highly portable) fit for storage. From looking at how objects are constructed, it seems as though it would be pretty trivial to keep around the JSON and expose it as necessary as opposed to just discarding it.
Perhaps __str__ could return the readable JSON representation and __repr__ could contain what currently happens from __str__ (the unambiguous object with its address)?
If there are concerns over memory, perhaps this could be a configurable option?
At any rate, I could help put together the patch but would first like to get your thoughts and whether or not you're open to merging in such a pull request
This seems a good idea. Using all the data returned by Github will preserve attributes that may have been added by Github, but not yet exposed by PyGithub.
Here are some things that must be taken care of:
Expose raw data of objects (Issue #144)
Add a way to create an object from raw data (Issue #144)
Fix doc for raw_data (issue #144)