praw 7.8.1


pip install praw

  Latest version

Released: Oct 25, 2024


Meta
Author: Bryce Boe
Maintainer: Bryce Boe, Joe RH, Joel Payne
Requires Python: ~=3.8

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers

License
  • OSI Approved :: BSD License

Natural Language
  • English

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12

Topic
  • Utilities
Latest PRAW Version Supported Python Versions PyPI - Downloads - Monthly GitHub Actions Status Coveralls Coverage OpenSSF Scorecard Contributor Covenant pre-commit Black code style

PRAW, an acronym for “Python Reddit API Wrapper”, is a Python package that allows for simple access to Reddit’s API. PRAW aims to be easy to use and internally follows all of Reddit’s API rules. With PRAW there’s no need to introduce sleep calls in your code. Give your client an appropriate user agent and you’re set.

Installation

PRAW is supported on Python 3.8+. The recommended way to install PRAW is via pip.

pip install praw

To install the latest development version of PRAW run the following instead:

pip install --upgrade https://github.com/praw-dev/praw/archive/master.zip

For instructions on installing Python and pip see “The Hitchhiker’s Guide to Python” Installation Guides.

Quickstart

Assuming you already have a credentials for a script-type OAuth application you can instantiate an instance of PRAW like so:

import praw

reddit = praw.Reddit(
    client_id="CLIENT_ID",
    client_secret="CLIENT_SECRET",
    password="PASSWORD",
    user_agent="USERAGENT",
    username="USERNAME",
)

With the reddit instance you can then interact with Reddit:

# Create a submission to r/test
reddit.subreddit("test").submit("Test Submission", url="https://reddit.com")

# Comment on a known submission
submission = reddit.submission(url="https://www.reddit.com/comments/5e1az9")
submission.reply("Super rad!")

# Reply to the first comment of a weekly top thread of a moderated community
submission = next(reddit.subreddit("mod").top(time_filter="week"))
submission.comments[0].reply("An automated reply")

# Output score for the first 256 items on the frontpage
for submission in reddit.front.hot(limit=256):
    print(submission.score)

# Obtain the moderator listing for r/test
for moderator in reddit.subreddit("test").moderator():
    print(moderator)

Please see PRAW’s documentation for more examples of what you can do with PRAW.

Discord Bots and Asynchronous Environments

If you plan on using PRAW in an asynchronous environment, (e.g., discord.py, asyncio) it is strongly recommended to use Async PRAW. It is the official asynchronous version of PRAW and its usage is similar and has the same features as PRAW.

PRAW Discussion and Support

For those new to Python, or would otherwise consider themselves a Python beginner, please consider asking questions on the r/learnpython subreddit. There are wonderful people there who can help with general Python and simple PRAW related questions.

Otherwise, there are a few official places to ask questions about PRAW:

r/redditdev is the best place on Reddit to ask PRAW related questions. This subreddit is for all Reddit API related discussion so please tag submissions with [PRAW]. Please perform a search on the subreddit first to see if anyone has similar questions.

Real-time chat can be conducted via the PRAW Slack Organization (please create an issue if that invite link has expired).

Please do not directly message any of the contributors via Reddit, email, or Slack unless they have indicated otherwise. We strongly encourage everyone to help others with their questions.

Please file bugs and feature requests as issues on GitHub after first searching to ensure a similar issue was not already filed. If such an issue already exists please give it a thumbs up reaction. Comments to issues containing additional information are certainly welcome.

Documentation

PRAW’s documentation is located at https://praw.readthedocs.io/.

History

August 2010: Timothy Mellor created a github project called reddit_api.

March 2011: The Python package reddit was registered and uploaded to pypi.

December 2011: Bryce Boe took over as maintainer of the reddit package.

June 2012: Bryce renamed the project PRAW and the repository was relocated to the newly created praw-dev organization on GitHub.

February 2016: Bryce began work on PRAW4, a complete rewrite of PRAW.

License

PRAW’s source (v4.0.0+) is provided under the Simplified BSD License.

  • Copyright ©, 2016, Bryce Boe

Earlier versions of PRAW were released under GPLv3.

7.8.1 Oct 25, 2024
7.8.0 Oct 20, 2024
7.7.1 Jul 11, 2023
7.7.0 Feb 25, 2023
7.6.1 Nov 11, 2022
7.6.0 May 10, 2022
7.5.0 Nov 14, 2021
7.4.0 Jul 30, 2021
7.3.0 Jun 17, 2021
7.2.0 Feb 24, 2021
7.1.4 Feb 07, 2021
7.1.3 Feb 05, 2021
7.1.2 Feb 03, 2021
7.1.1 Feb 03, 2021
7.1.0 Jun 23, 2020
7.0.0 Apr 25, 2020
6.5.1 Jan 07, 2020
6.5.0 Jan 06, 2020
6.4.0 Sep 21, 2019
6.3.1 Jun 10, 2019
6.2.0 May 06, 2019
6.1.1 Jan 29, 2019
6.1.0 Jan 19, 2019
6.0.0 Jul 24, 2018
5.4.0 Mar 28, 2018
5.3.0 Dec 17, 2017
5.2.0 Oct 24, 2017
5.1.0 Sep 01, 2017
5.0.1 Jul 12, 2017
5.0.0 Jul 04, 2017
4.6.0 Jul 04, 2017
4.5.1 May 08, 2017
4.5.0 Apr 30, 2017
4.4.0 Feb 21, 2017
4.3.0 Jan 19, 2017
4.2.0 Jan 07, 2017
4.1.0 Dec 24, 2016
4.0.0 Nov 29, 2016
4.0.0rc3 Nov 26, 2016
4.0.0rc2 Nov 21, 2016
4.0.0rc1 Nov 21, 2016
4.0.0b23 Nov 16, 2016
4.0.0b22 Nov 13, 2016
4.0.0b21 Oct 18, 2016
4.0.0b20 Sep 26, 2016
4.0.0b19 Sep 25, 2016
4.0.0b18 Sep 25, 2016
4.0.0b17 Aug 30, 2016
4.0.0b16 Aug 24, 2016
4.0.0b15 Aug 23, 2016
4.0.0b14 Aug 16, 2016
4.0.0b13 Aug 08, 2016
4.0.0b12 Aug 02, 2016
4.0.0b11 Jul 25, 2016
4.0.0b10 Jul 17, 2016
4.0.0b9 Jul 17, 2016
4.0.0b8 Jul 12, 2016
4.0.0b7 Jul 04, 2016
4.0.0b6 Jul 04, 2016
4.0.0b5 Jul 04, 2016
4.0.0b4 Mar 25, 2016
4.0.0b3 Mar 25, 2016
4.0.0b2 Mar 25, 2016
4.0.0b1 Mar 25, 2016
3.6.2 Oct 29, 2017
3.6.1 Jan 10, 2017
3.6.0 Nov 14, 2016
3.5.0 May 10, 2016
3.4.0 Feb 22, 2016
3.3.0 Oct 03, 2015
3.2.1 Aug 19, 2015
3.2.0 Aug 14, 2015
3.1.0 Jul 08, 2015
3.0.0 Jun 16, 2015
2.1.21 Mar 26, 2015
2.1.20 Jan 23, 2015
2.1.19 Nov 04, 2014
2.1.18 Aug 06, 2014
2.1.17 Jun 18, 2014
2.1.16 May 12, 2014
2.1.15 Apr 20, 2014
2.1.14 Feb 24, 2014
2.1.13 Feb 24, 2014
2.1.12 Jan 07, 2014
2.1.11 Oct 24, 2013
2.1.10 Oct 14, 2013
2.1.9 Oct 07, 2013
2.1.8 Sep 29, 2013
2.1.7 Sep 21, 2013
2.1.6 Sep 13, 2013
2.1.5 Aug 23, 2013
2.1.4 Jul 18, 2013
2.1.3 May 18, 2013
2.1.2 May 11, 2013
2.1.1 May 01, 2013
2.1.0 Apr 27, 2013
2.0.15 Apr 06, 2013
2.0.14 Mar 18, 2013
2.0.13 Mar 15, 2013
2.0.12 Mar 01, 2013
2.0.11 Feb 23, 2013
2.0.10 Feb 17, 2013
2.0.8 Feb 02, 2013
2.0.7 Feb 01, 2013
2.0.6 Jan 26, 2013
2.0.5 Jan 22, 2013
2.0.4 Jan 21, 2013
2.0.3 Jan 21, 2013
2.0.2 Jan 18, 2013
2.0.1 Jan 18, 2013
2.0 Jan 17, 2013
1.0.16 Nov 16, 2012
1.0.15 Nov 06, 2012
1.0.14 Nov 01, 2012
1.0.13 Oct 16, 2012
1.0.12 Sep 28, 2012
1.0.11 Sep 28, 2012
1.0.10 Sep 27, 2012
1.0.9 Sep 25, 2012
1.0.8 Sep 23, 2012
1.0.7 Sep 11, 2012
1.0.6 Aug 28, 2012
1.0.5 Aug 19, 2012
1.0.4 Aug 12, 2012
1.0.3 Aug 01, 2012
1.0.2 Jul 29, 2012
1.0.1 Jul 11, 2012
1.0 Jul 01, 2012

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
prawcore (<3,>=2.4)
update_checker (>=0.18)
websocket-client (>=0.54.0)