-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Where did json_dict go? #701
Comments
Hi, great question. You're the first to ask about it. It's not currently available. Can you help me understand what your use case is for having it? It's probably something we could add back, I just want to understand the reasoning for it. |
Hi, Sure! I'm currently making Pyroon, a script which converts switch-a-roos into an interactive graph. The back-end can parse switch-a-roo chains and either save them or export them as Cytoscape.js formatted JSON. The front-end loads the formatted JSON and displays the graph.
tl;dr backing up switch-a-roos |
Would using the pickle support PRAW has be a suitable alternative? Here's an example:
|
I probably should have mentioned* I was also hoping to access the whole Reddit response from the front-end, to display information about roo comments when they're clicked on. While serialising the comment via pickle would probably be the best solution for the back-end it wouldn't be readable by the front. I could always just write a helper for Pyroon to copy the 10 or so properties into a dict, something like: def serialize(comment):
return {
'stickied': comment.stickied,
'author': str(comment.author),
'subreddit': str(comment.subreddit),
# etc...
} *Sorry, my brain doesn't seem to be working much today |
If you can manually json serialize just the properties you want I'd prefer that to exposing the underlying response for simplicity on PRAW's end. Please let me know if that's suitable. |
That'd probably be best. I mostly didn't want to reinvent the wheel if the json_dict property still existed, just under a different name. Plus it'll make my code more explicit, which is always a plus. |
Great. I'm going to close this issue for now. Thanks for bringing it up. |
@bboe is it really not possible to access the full response from the Reddit API in JSON form? That seems like it should definitely be possible with this library... |
It's completely possible. You just need to make a call to |
Ah, perfect! Thanks very much @PythonCoderAS ! |
|
I was wondering where the property
json_dict
of Reddit objects went? I can't seem to find any other way of retrieving the original JSON object returned by Reddit.I've found many references to the property in past on this repo and StackOverflow but not what it was renamed to or why it was removed.
System Information
PRAW Version: 4.1.0
Python Version: 2.7
Operating System: Windows 10 (unfortunately)
The text was updated successfully, but these errors were encountered: