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.3-py3-none-manylinux2014_x86_64.whl (23.0 kB view details)

Uploaded Python 3

redscrapslib-0.1.3-py3-none-macosx_12_0_universal2.whl (23.0 kB view details)

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

redscrapslib-0.1.3-cp313-cp313-win_amd64.whl (23.0 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.3-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 91e5a32e20ad7e6c6d9bb54daeb865f763c8459de4946f6cadf75d339bf4d2c5
MD5 bd5ad8bbe805e4912e5524da540a331c
BLAKE2b-256 d4b5ff72d4a8468a51c14851b57346ffa4c5c12e6f683cff52d7bcab68e158f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.3-py3-none-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 e7a96b27ae7c1624ee4b76bb372eae42b9e2a44e373cd03023e118217a80691e
MD5 4b32f2cb42aad8ef65f7eb8b0b00b7a2
BLAKE2b-256 754716c2d56dec7e85e2e6d27bce1d283d506bb9a71138e4b2784500cd592dc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2d9cd58401637c1b5cd7e843c95679952a8fad2dccd263410a10e4783e594c88
MD5 1cc18eab08e1b8d68bec541fd59d2c61
BLAKE2b-256 1210e43698a7fa4ecaaed5509005dfe9b2f60fedc0e940ae03ea1b641307c67a

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