Skip to main content

Python library for scraping Reddit data, powered by a .NET 9 backend

Project description

RedScrapsLib

A Python library for scraping Reddit data (posts, comments, user activity) without the official API. Backed by a .NET 9 assembly via pythonnet, with automatic rate-limit handling.

Requirements

  • Python 3.10+
  • Windows x64 or macOS 12+ (Apple Silicon and Intel) or Linux x86_64 (including WSL2)
  • .NET 10 Runtime — must be installed separately; pip cannot install it

Installation

pip install redscrapslib

Quick start

import RedScrapsLib as rs

rs.init(user_agent="MyBot/1.0")

# Subreddit posts
posts = rs.get_home("python", limit=10)
for post in posts.Posts:
    print(post.Title, post.Author)

# Post comments
comments = rs.get_comments("python", post_id="abc123", limit=50)

# User activity
submissions = rs.get_user_posts("spez", limit=25)
user_comments = rs.get_user_comments("spez", limit=25)

# Session stats
print(rs.get_stats())
# {'calls': 4, 'rate_limit_hits': 0, 'total_wait_seconds': 0.0}

Rate limiting is handled automatically. If Reddit returns a 429, the library waits the required time and retries — no extra code needed.

API

init(user_agent=None, debug=False)

Must be called once before any other function.

get_home(subreddit, sort="hot", limit=100, time=None, after=None) → HomeSent

get_comments(subreddit, post_id, sort="confidence", limit=100) → CommentSent

get_user_posts(user, sort=None, limit=None, time=None, after=None) → UserSubmittedSent

get_user_comments(user, sort=None, limit=None, time=None, after=None) → UserCommentsSent

get_stats() → dict

Returns {'calls': int, 'rate_limit_hits': int, 'total_wait_seconds': float}.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

redscrapslib-0.1.4-py3-none-manylinux2014_x86_64.whl (23.1 kB view details)

Uploaded Python 3

redscrapslib-0.1.4-py3-none-macosx_12_0_universal2.whl (23.1 kB view details)

Uploaded Python 3macOS 12.0+ universal2 (ARM64, x86-64)

redscrapslib-0.1.4-cp313-cp313-win_amd64.whl (23.1 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file redscrapslib-0.1.4-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redscrapslib-0.1.4-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 52eb30252afc7f747a816c0cb796e4a3abec41179ec0e8f5382e01d720244885
MD5 4a57a8fdc3fbd1b055132a8c88e7e765
BLAKE2b-256 941344d32bc27e4c88b53f94f9bf70489e65f4f16e27d712c53624204c8cb894

See more details on using hashes here.

File details

Details for the file redscrapslib-0.1.4-py3-none-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for redscrapslib-0.1.4-py3-none-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 0955d623aa31c3fbe21e742aec09a4c446f25b69feeb2e37fac1ae9f714f5813
MD5 95359ae2c5f94da5e5f2ae755a3da001
BLAKE2b-256 75af34726e49ae1645142b0450a452daf16ae58b336355f7a0b8f33bfb0602d7

See more details on using hashes here.

File details

Details for the file redscrapslib-0.1.4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for redscrapslib-0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a255fb1cc1af06d5b0c6e1cacc6cc1e59af0a501fba0195052a0a3a45dcdd3d7
MD5 9fffd348ad37a1088445264a8b2fb517
BLAKE2b-256 077fc787ecaab061e88695dc9610fbc95775b5bb7e14800100db1a9f45bda4de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page