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

Uploaded Python 3

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

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

redscrapslib-0.1.2-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.2-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redscrapslib-0.1.2-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fd4c79537dcc7376555a8379b5b8c76142b1879877e03877b0d64fdf0ff87f3
MD5 9fc266f23540733d791ad8f660731627
BLAKE2b-256 3c3ef38e2de3f47ef248a5caf774bf3ab88aef6602be8c840df37acff9f57beb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.2-py3-none-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 c7d14f7dc620517b87fb4751c854e1b3469800d6165e3032f29daaef05b2dfd2
MD5 00b4461597f0ad990b0da9e6c7d6d403
BLAKE2b-256 1f1dda39248551521bdd78fea7531bbc47d5bbc6529413a2f97724319a9f0690

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1fe4390ba8c9ba0d8857b4ea6536045fbde7dd1db0d5d39374f9558280042c49
MD5 457809d5aab0db3055ad13cb1bd13b89
BLAKE2b-256 d62e189f61f306a96a18a37ad0a818f2c7c90e20a5381acb52cd40ba7cca586b

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