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

Uploaded Python 3

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

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

redscrapslib-0.1.1-cp313-cp313-win_amd64.whl (22.9 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed3809c197238e22100d24bda209411326852f7d02f0165b3f4eb423df7281f2
MD5 263c979c3b80ba77c30d36e7a1bb6d40
BLAKE2b-256 f10a9e808bb9afc043e4c0d1bbd2ad1d26bdebdbf84904f451fd097aaae5a3cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.1-py3-none-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 1685d7b97c8d6b8e39fba4f3bc3eedf472110929f6cc2e36dfb598bc7bec7080
MD5 1e36817557a414fc2ea33bb8d8085dfe
BLAKE2b-256 f7072ce8201531b4f8e3daca114945baa1fac56cc046b24f2fe077f6da751c6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redscrapslib-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ec19a130ab3bd38baddfc10118a5942a8c96aae07e976732462e965d1e3cd670
MD5 d564f7509a888217c97473572a209078
BLAKE2b-256 db9771ba78dba6cc626b8804478da6d3837c7750f2750636386f2e2de7dac3a0

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