RedditEasy is an API wrapper for the Reddit JSON API
Project description
RedditEasy
RedditEasy is an API wrapper for the Reddit JSON API
Install
To install RedditEasy, do:
pip install redditeasy
OR
python -m pip install redditeasy
Documentation
Docs can be found here
Usage
import redditeasy
"""
To get your client ID, client secret and user agent go to:
https://www.reddit.com/prefs/apps
and create an app
"""
post = redditeasy.Subreddit(subreddit="dankmemes", #Subreddit name
client_id="", #Your client ID
client_secret="", #Your client secret
user_agent="" #Your user agent (ex: ClientName/0.1 by YourUsername")
)
postoutput = post.get_post()
print(f"Posts Title: {postoutput.title}\n"
f"Posts Content: {postoutput.content}\n"
f"Posts Author: u/{postoutput.author}\n"
f"Posts URL: {postoutput.post_url}\n"
f"Spoiler?: {postoutput.spoiler}\n"
f"Post Created At: {postoutput.created_at}\n"
f"Posts Upvote Count: {postoutput.score}\n"
f"Posts Award Count: {postoutput.total_awards}\n"
f"NSFW?: {postoutput.nsfw}\n"
f"Post Flair: {postoutput.post_flair}\n"
f"User Flair: {postoutput.author_flair}\n"
f"Subreddit Subscribers: {postoutput.subreddit_subscribers}")
More examples are in the examples folder
Errors
The module will raise KeyError
if the given user / subreddit is not found
The module will raise redditeasy.exceptions.RequestError
if there was an error with the request. Traceback will show the details about the error
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
redditeasy-2.5.0.tar.gz
(5.6 kB
view hashes)
Built Distribution
redditeasy-2.5.0-py3-none-any.whl
(18.9 kB
view hashes)
Close
Hashes for redditeasy-2.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc8c85e9d0f4de46bff8d03d4f87ad2aaa7f83e55b779a643209c45eff2a1727 |
|
MD5 | cde0dd11c05a857af7e076c81d94da1f |
|
BLAKE2b-256 | 2a14a467e862ff2f448a1d6d5d70c7f596ffb9a4d66d41bc463b03fd6c5e83b9 |