Generate detailed, structured, and visual personas of Reddit users using their public activity. This project uses Reddit's API for scraping and Cohere's LLMs to generate human-like persona descriptions — perfect for marketing research, UX personas, or social analysis.
- Takes a Reddit profile URL as input (e.g.
https://www.reddit.com/user/SuperbPercentage8050/) - Scrapes recent posts and comments using
praw - Sends this data to Cohere’s LLM to generate a structured user persona
- Saves the persona in a clean
.txtfile - Optionally converts the persona into a polished image format (PNG)
reddit-persona/
├── data/ # JSON scraped data from Reddit
├── output/ # Generated persona .txt and .png files
├── main.py # Main CLI script (single-command execution)
├── reddit_scraper.py # Reddit data scraper using PRAW
├── persona_generator.py # Persona generator using Cohere API
├── visual_generator.py # Converts persona .txt into styled PNG
├── .env # Contains API keys (excluded from version control)
├── requirements.txt # Python dependencies
├── Arial.ttf # Arial font file
└── README.md # Project documentationgit clone https://github.com/IshaanPathak25/ReddiScope.git
cd ReddiScopepython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -r requirements.txtTo run this project, you'll need API credentials for both Reddit and Cohere. Here's how to get them:
- Visit https://www.reddit.com/prefs/apps while logged into your Reddit account.
- Scroll to the bottom and click "Create App" or "Create Another App".
- Fill in the following fields:
- Name: Anything (e.g.,
RedditPersonaApp) - App type: Select "script"
- Redirect URI: Enter
http://localhost - Description: Optional
- Name: Anything (e.g.,
- After creation, you'll see:
- Client ID (under the app name)
- Client Secret (shown below the redirect URI)
Save these for use in your .env file:
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USER_AGENT=your_custom_user_agent- Go to https://dashboard.cohere.com/api-keys
- Sign up or log in, then copy your default API Key
- Add it to your .env file:
COHERE_API_KEY=your_cohere_api_key- Scrape Reddit user data using PRAW
- Generate detailed personas using Cohere’s command-r-plus model
python main.py👋 Welcome to Reddit Persona Generator!
🔗 Enter Reddit profile URL: https://www.reddit.com/user/SuperbPercentage8050/
...
✅ Persona saved to: output/SuperbPercentage8050_persona.txt
✅ Visual persona saved as: output/SuperbPercentage8050_persona.png👋 Welcome to Reddit Persona Generator!
🔗 Enter Reddit profile URL: https://www.reddit.com/user/SuperbPercentage8050/
...
✅ Persona saved to: output/SuperbPercentage8050_persona.txt
✅ Visual persona saved as: output/SuperbPercentage8050_persona.png- cohere – Used to generate personas using the Cohere LLM API.
- praw – For scraping Reddit user data (posts and comments).
- tqdm – Adds progress bars while fetching data from Reddit.
- python-dotenv – Loads API keys and secrets from a
.envfile. - Pillow – Creates clean, styled PNG visual personas from text files.
pip install -r requirements.txt- 🖥️ Build a GUI version (Tkinter / Streamlit / Gradio)
- 📄 Export persona as PDF
- 🌐 Deploy web version on Hugging Face Spaces
-
Reddit API (via PRAW)
Used to scrape user posts and comments from Reddit in a structured format using Python Reddit API Wrapper (PRAW). -
Cohere LLMs
Generates structured and insightful personas using Cohere'scommand-r-pluslanguage model API. -
Pillow
Python Imaging Library (PIL fork) used to create visual representations of user personas as dynamically generated PNGs. -
Python 3.9+
The core programming language used for all scraping, processing, and persona generation tasks.
This project is licensed under the MIT License. Feel free to fork, modify, and build upon it. Just give credit. 🙌
Ishaan Pathak