jcrabapple/hermes-skills/praw-subreddit-listings

Claude Code and agent skill by jcrabapple/hermes-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

List and search subreddits via PRAW's Subreddits class.

Install

npx vskill@latest install jcrabapple/hermes-skills/praw-subreddit-listings

SKILL.md

The same SKILL.md was published earlier as jcrabapple/hermes-skills/praw-subreddit-listings.

PRAW Subreddit Listings

Access the praw.models.Subreddits Listing class — the collection-level API for enumerating and searching subreddits through a praw.Reddit instance (reddit.subreddits). Covers the 10 documented members of the class: default, new, popular, premium, recommended, search, search_by_name, stream, parse, __init__. Does NOT cover the per-subreddit Subreddit model class (that is a separate docs page), moderation, flair, or the reddit.subreddit page. Source: PRAW 8.0.2 docs, code_overview/reddit/subreddits.html.

When to Use

  • Enumerate default / new / popular / premium subreddit lists
  • Full-text search of subreddits by title or description
  • Find subreddits whose names start with a prefix (name lookup, not text search)
  • Get "similar subreddits" recommendations for a set of subreddits
  • Stream newly-created subreddits in near-real-time
  • Any task needing a listing of subreddits (not content inside one subreddit)

Prerequisites

  • praw installed: pip install praw (PRAW 8.x, docs are 8.0.2)
  • A praw.Reddit instance with valid credentials. Read-only listing endpoints work with script-type app credentials (client_id, client_secret, user_agent). Setup: see Installing PRAW (https://praw.readthedocs.io/en/stable/getting_started/installation.html) and Authenticating via OAuth (https://praw.readthedocs.io/en/stable/getting_started/authentication.html). All methods below are invoked on that instance's reddit.subreddits attribute.
  • Reddit API rate limits apply (see https://praw.readthedocs.io/en/stable/getting_started/ratelimits.html).

How to Run

Invoke through the terminal tool, e.g. write a script with write_file then run python script.py. The class is praw.models.Subreddits; you never construct it directly — you use the reddit.subreddits attribute of a configured Reddit instance.

Quick Reference

MethodSignatureReturns
default()default(**generator_kwargs)Iterator[Subreddit]
new()new(**generator_kwargs)Iterator[Subreddit]
popular()popular(**generator_kwargs)Iterator[Subreddit]
premium()premium(**generator_kwargs)Iterator[Subreddit]
recommended()recommended(subreddits, omit_subreddits=None)list[Subreddit]
search()search(query, **generator_kwargs)Iterator[Subreddit]
search_by_name()search_by_name(query, *, exact=False, include_nsfw=True)list[Subreddit]
stream()stream(**stream_options)Iterator[Subreddit]
parse()parse(data, reddit) (classmethod)PRAWBase instance

Procedure

  1. Configure a Reddit instance (see Prerequisites). All listings hang off reddit.subreddits.
  2. Pick the listing method for the task:
  • Predefined lists: iterate reddit.subreddits.default(), .new(), .popular(), or .premium(). Each returns a lazily-evaluated ListingGenerator; you must iterate it to trigger requests.
  • Text search: reddit.subreddits.search("query") — matches subreddits by BOTH title and description. Use for topical discovery.
  • Name lookup: reddit.subreddits.search_by_name("ask", exact=False, include_nsfw=True) — finds subreddits whose names BEGIN with the query string. exact=True returns only exact name matches; include_nsfw=False excludes NSFW-labeled subreddits. Returns a plain list, not a generator.
  • Recommendations: reddit.subreddits.recommended(["python", "learnpython"], omit_subreddits=["learnprogramming"]) — accepts subreddit names and/or Subreddit instances in both args; returns a list.
  • Streaming: reddit.subreddits.stream() — yields new subreddits as created, oldest first, seeding with up to 100 historical subreddits on start.
  1. Handle results. Listing methods yield Subreddit objects, so access attributes like .display_name, .subscribers, etc. (see the Subreddit model docs page for the full attribute list — not covered here).
  2. Control pagination by passing generator_kwargs (e.g. page size) to the listing methods; these are forwarded verbatim to ListingGenerator initialization (https://praw.readthedocs.io/en/stable/code_overview/other/listinggenerator.html). stream()'s kwargs are forwarded to stream_generator() in praw.models.util (https://praw.readthedocs.io/en/stable/code_overview/other/util.html#praw.models.util.stream_generator).

Pitfalls

  • search() and search_by_name() are NOT interchangeable: search does full-text over title+description; search_by_name does name-prefix matching only. Picking the wrong one returns empty or irrelevant results.
  • search_by_name() and recommended() return plain Python lists. Do not pass pagination generator_kwargs to them — they accept none (keyword-only exact/include_nsfw on search_by_name) and extra kwargs raise TypeError.
  • recommended()'s omit_subreddits exclusion "may not work as expected" per the docs — Reddit's endpoint is unreliable about honoring exclusions. Filter client-side if exclusion is critical.
  • stream() starts by replaying up to 100 historical subreddits (oldest first) before live items — dedupe if you only want new creations.
  • All listing methods are lazy iterators; nothing is fetched until you iterate. A bare call like reddit.subreddits.popular() with no loop does nothing.
  • parse() is a classmethod returning a PRAWBase instance from raw dict data — only reach for it when constructing from cached/stored JSON, not for normal use.

Verification

A script that proves the skill end-to-end with one network hit:

python
import praw
reddit = praw.Reddit(client_id="...", client_secret="...", user_agent="...")
hits = reddit.subreddits.search_by_name("ask", exact=True, include_nsfw=False)
print(hits[0].display_name if hits else "no exact match")

Expect ask (or the exact-name subreddit you queried) printed. If creds are unavailable, syntax-check instead: python -m py_compile script.py.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jcrabapple/hermes-skills/praw-subreddit-listings/badge)](https://verified-skill.com/skills/jcrabapple/hermes-skills/praw-subreddit-listings)

Something wrong with this skill or its page? Tell us.