Refactor Reddit data pipeline structure
Browse files
README.md
CHANGED
|
@@ -6,63 +6,62 @@ A comprehensive pipeline for archiving, processing, and analyzing Reddit data fr
|
|
| 6 |
|
| 7 |
## ποΈ Repository Structure
|
| 8 |
|
| 9 |
-
```
|
| 10 |
-
βββ
|
| 11 |
-
|
| 12 |
-
β
|
| 13 |
-
β βββ
|
| 14 |
-
β β βββ
|
| 15 |
-
β β
|
| 16 |
-
β β
|
| 17 |
-
β β
|
| 18 |
-
β β βββ
|
| 19 |
-
β βββ
|
| 20 |
-
β
|
|
|
|
|
|
|
| 21 |
β
|
| 22 |
-
βββ
|
| 23 |
-
β βββ comments/
|
| 24 |
-
β β
|
| 25 |
-
β
|
| 26 |
-
β
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
β
|
| 28 |
-
βββ
|
| 29 |
-
β βββ
|
| 30 |
-
β β βββ
|
| 31 |
-
β
|
| 32 |
-
β
|
| 33 |
-
β βββ comments/
|
| 34 |
-
β βββ submissions/
|
| 35 |
β
|
| 36 |
-
βββ original_dump/
|
| 37 |
-
β βββ comments/
|
| 38 |
-
β β βββ RC_2005-12.zst ββ RC_2025-12.zst #
|
| 39 |
-
β β βββ schema_analysis/
|
| 40 |
-
β βββ submissions/
|
| 41 |
-
β βββ RS_2005-06.zst ββ RS_2025-12.zst #
|
| 42 |
-
β βββ schema_analysis/
|
| 43 |
β βββ analysis_report_2005.txt
|
| 44 |
-
β βββ ...
|
| 45 |
β
|
| 46 |
-
βββ
|
| 47 |
-
β βββ
|
| 48 |
-
β βββ
|
| 49 |
-
β
|
| 50 |
-
β
|
| 51 |
-
β β βββ 01/ # Daily image collections
|
| 52 |
-
β βββ thumbnails/ # Thumbnail versions
|
| 53 |
-
β βββ videos/ # Video media
|
| 54 |
β
|
| 55 |
-
βββ
|
| 56 |
-
|
| 57 |
-
β βββ type_restricted.jsonl # 1.92M restricted subreddits
|
| 58 |
-
β βββ type_private.jsonl # 182K private subreddits
|
| 59 |
-
β βββ type_user.jsonl # 16.98M user subreddits (profiles)
|
| 60 |
-
β βββ type_other.jsonl # 100 other/archived
|
| 61 |
-
β
|
| 62 |
-
βββ .gitattributes # Git LFS configuration
|
| 63 |
-
βββ README.md # This file
|
| 64 |
```
|
| 65 |
|
|
|
|
| 66 |
## π Dataset Statistics
|
| 67 |
|
| 68 |
### Subreddit Ecosystem (January 2025)
|
|
@@ -94,7 +93,7 @@ A comprehensive pipeline for archiving, processing, and analyzing Reddit data fr
|
|
| 94 |
- Field-by-field statistical analysis
|
| 95 |
- Type distribution tracking
|
| 96 |
- Null/empty value profiling
|
| 97 |
-
- Schema evolution tracking (2005-2018 complete)
|
| 98 |
|
| 99 |
### Stage 3: Format Conversion
|
| 100 |
- ZST β JSONL decompression
|
|
@@ -180,33 +179,6 @@ A comprehensive pipeline for archiving, processing, and analyzing Reddit data fr
|
|
| 180 |
- **Moderation scale:** 32% removed by Reddit, 36% by moderators
|
| 181 |
- **Media evolution:** Video posts growing (3% in Jan 2025)
|
| 182 |
|
| 183 |
-
## π Getting Started
|
| 184 |
-
|
| 185 |
-
### Prerequisites
|
| 186 |
-
- 100+ TB storage (recommended)
|
| 187 |
-
- Python 3.9+ with pandas, pyarrow, zstandard
|
| 188 |
-
- Apache Spark (optional, for large-scale processing)
|
| 189 |
-
- Git LFS for media storage
|
| 190 |
-
|
| 191 |
-
### Basic Usage
|
| 192 |
-
```bash
|
| 193 |
-
# Analyze schema of a monthly file
|
| 194 |
-
python analyze_schema.py original_dump/comments/RC_2025-01.zst
|
| 195 |
-
|
| 196 |
-
# Convert to Parquet format
|
| 197 |
-
python convert_to_parquet.py original_dump/comments/RC_2025-01.zst converted_parquet/comments/2025/
|
| 198 |
-
|
| 199 |
-
# Analyze subreddit distribution
|
| 200 |
-
python analyze_subreddits.py subreddits_2025-01.jsonl
|
| 201 |
-
```
|
| 202 |
-
|
| 203 |
-
### Processing Pipeline
|
| 204 |
-
1. Download monthly archives to `original_dump/`
|
| 205 |
-
2. Run schema analysis for quality assessment
|
| 206 |
-
3. Convert to partitioned Parquet format
|
| 207 |
-
4. Categorize and analyze subreddit metadata
|
| 208 |
-
5. Extract and organize media content
|
| 209 |
-
6. Conduct focused community studies
|
| 210 |
|
| 211 |
## π License & Attribution
|
| 212 |
|
|
@@ -252,9 +224,3 @@ tools for Reddit historical data (2005-2025). GitHub Repository.
|
|
| 252 |
- Cross-platform comparative studies
|
| 253 |
|
| 254 |
---
|
| 255 |
-
**Maintained by:** Reddit Research Group
|
| 256 |
-
**Last Updated:** January 2026
|
| 257 |
-
**Data Coverage:** December 2005 - December 2025
|
| 258 |
-
**Total Volume:** ~150 TB (raw), ~40 TB (processed)
|
| 259 |
-
|
| 260 |
-
|
|
|
|
| 6 |
|
| 7 |
## ποΈ Repository Structure
|
| 8 |
|
| 9 |
+
```bash
|
| 10 |
+
βββ scripts/ # Analysis scripts
|
| 11 |
+
βββ analysis/ # Analysis methods and visualizations
|
| 12 |
+
β βββ original_schema_analysis/ # Schema evolution analysis
|
| 13 |
+
β β βββ comments/ # Comment schema analysis results
|
| 14 |
+
β β βββ figures/ # Schema analysis visualizations
|
| 15 |
+
β β βββ submissions/ # Submission schema analysis results
|
| 16 |
+
β β βββ analysis_report_2005.txt
|
| 17 |
+
β β βββ analysis_report_2006.txt
|
| 18 |
+
β β βββ ...
|
| 19 |
+
β βββ parquet_subreddits_analysis/ # Analysis of Parquet-converted data
|
| 20 |
+
β βββ comments/ # Comment data analysis
|
| 21 |
+
β βββ figures/ # Subreddit analysis visualizations
|
| 22 |
+
β βββ submissions/ # Submission data analysis
|
| 23 |
β
|
| 24 |
+
βββ analyzed_subreddits/ # Focused subreddit case studies
|
| 25 |
+
β βββ comments/ # Subreddit-specific comment archives
|
| 26 |
+
β β βββ RC_funny.parquet # r/funny comments (empty as of now)
|
| 27 |
+
β βββ reddit-media/ # Media organized by subreddit and date
|
| 28 |
+
β β βββ content-hashed/ # Deduplicated media (content addressing)
|
| 29 |
+
β β βββ images/ # Image media
|
| 30 |
+
β β β βββ r_funny/ # Organized by subreddit
|
| 31 |
+
β β β βββ 2025/01/01/ # Daily structure for temporal analysis
|
| 32 |
+
β β βββ videos/ # Video media
|
| 33 |
+
β β βββ r_funny/ # Organized by subreddit
|
| 34 |
+
β β βββ 2025/01/01/ # Daily structure
|
| 35 |
+
β βββ submissions/ # Subreddit-specific submission archives
|
| 36 |
+
β βββ RS_funny.parquet # r/funny submissions (empty as of now)
|
| 37 |
β
|
| 38 |
+
βββ converted_parquet/ # Optimized Parquet format (year-partitioned)
|
| 39 |
+
β βββ comments/ # Comments 2005-2025
|
| 40 |
+
β β βββ 2005/ ββ 2025/ # Year partitions for efficient querying
|
| 41 |
+
β βββ submissions/ # Submissions 2005-2025
|
| 42 |
+
β βββ 2005/ ββ 2025/ # Year partitions
|
|
|
|
|
|
|
| 43 |
β
|
| 44 |
+
βββ original_dump/ # Raw downloaded Reddit archives
|
| 45 |
+
β βββ comments/ # Monthly comment archives (ZST compressed)
|
| 46 |
+
β β βββ RC_2005-12.zst ββ RC_2025-12.zst # Complete 2005-2025 coverage
|
| 47 |
+
β β βββ schema_analysis/ # Schema analysis directory
|
| 48 |
+
β βββ submissions/ # Monthly submission archives
|
| 49 |
+
β βββ RS_2005-06.zst ββ RS_2025-12.zst # Complete 2005-2025 coverage
|
| 50 |
+
β βββ schema_analysis/ # Schema evolution analysis reports
|
| 51 |
β βββ analysis_report_2005.txt
|
| 52 |
+
β βββ ...
|
| 53 |
β
|
| 54 |
+
βββ subreddits_2025-01_* # Subreddit metadata (January 2025 snapshot)
|
| 55 |
+
β βββ type_public.jsonl # 2.78M public subreddits
|
| 56 |
+
β βββ type_restricted.jsonl # 1.92M restricted subreddits
|
| 57 |
+
β βββ type_private.jsonl # 182K private subreddits
|
| 58 |
+
β βββ type_other.jsonl # 100 other/archived subreddits
|
|
|
|
|
|
|
|
|
|
| 59 |
β
|
| 60 |
+
βββ .gitattributes # Git LFS configuration for large files
|
| 61 |
+
βββ README.md # This documentation file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
```
|
| 63 |
|
| 64 |
+
|
| 65 |
## π Dataset Statistics
|
| 66 |
|
| 67 |
### Subreddit Ecosystem (January 2025)
|
|
|
|
| 93 |
- Field-by-field statistical analysis
|
| 94 |
- Type distribution tracking
|
| 95 |
- Null/empty value profiling
|
| 96 |
+
- Schema evolution tracking (2005-2018 complete more coming soon)
|
| 97 |
|
| 98 |
### Stage 3: Format Conversion
|
| 99 |
- ZST β JSONL decompression
|
|
|
|
| 179 |
- **Moderation scale:** 32% removed by Reddit, 36% by moderators
|
| 180 |
- **Media evolution:** Video posts growing (3% in Jan 2025)
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
## π License & Attribution
|
| 184 |
|
|
|
|
| 224 |
- Cross-platform comparative studies
|
| 225 |
|
| 226 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|