reddit_api is a Python wrapper for Reddit's API, aiming to be as easy to use as possible. Here's a quick peek, getting the first 10 stories from the 'hot' section of the 'opensource' subreddit.
import reddit
r = reddit.Reddit(user_agent="my_cool_application")
stories = r.get_subreddit('opensource').get_hot(limit=5)
list(stories)
this displays
[< Submission: 1 :: OpenFOAM: Open Source Computational Fluid Dynamics >,
< Submission: 9 :: My new open source project, Bunchify >,
< Submission: 93 :: Arrested while contributing to OpenStreetMap >,
< Submission: 27 :: DK: 25,000 hospital staff Copenhagen region to use open source office suite >,
< Submission: 24 :: Eclipse online >]
Install
You can install via pip
pip install reddit
Or via setup.py
python setup.py install
Product's homepage
Requirements:
· Python