{"id":29802969,"url":"https://github.com/ashmit-kumar/redditmindmap","last_synced_at":"2025-10-29T21:01:57.176Z","repository":{"id":304869695,"uuid":"1020247351","full_name":"Ashmit-Kumar/RedditMindMap","owner":"Ashmit-Kumar","description":"RedditPersonaExtractor is a Python tool that scrapes a Reddit user's posts and comments, then uses an LLM to generate a detailed, citation-backed user persona.","archived":false,"fork":false,"pushed_at":"2025-07-25T11:20:34.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T17:38:36.238Z","etag":null,"topics":["generative-ai","llm","persona-generation","web-scraping"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ashmit-Kumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-15T15:09:57.000Z","updated_at":"2025-07-25T11:20:38.000Z","dependencies_parsed_at":"2025-07-16T21:17:27.052Z","dependency_job_id":"088a5c0f-a440-4008-a1c8-ba4e6635fbbf","html_url":"https://github.com/Ashmit-Kumar/RedditMindMap","commit_stats":null,"previous_names":["ashmit-kumar/redditmindmap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ashmit-Kumar/RedditMindMap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2FRedditMindMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2FRedditMindMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2FRedditMindMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2FRedditMindMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ashmit-Kumar","download_url":"https://codeload.github.com/Ashmit-Kumar/RedditMindMap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2FRedditMindMap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267504043,"owners_count":24098336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generative-ai","llm","persona-generation","web-scraping"],"created_at":"2025-07-28T10:44:53.553Z","updated_at":"2025-10-29T21:01:57.169Z","avatar_url":"https://github.com/Ashmit-Kumar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reddit User Persona Generator\n\nThis is a Python-based project that generates a detailed **user persona** by analyzing a Reddit user’s **posts** and **comments** using **LLM-based natural language analysis**. The output includes characteristics like interests, personality traits, writing tone, and more — along with proper citations from Reddit.\n\nThis project was built as part of the Generative AI Internship Assignment for **BeyondChats**.\n\n---\n\n## 🚀 Features\n\n- Scrapes recent Reddit posts and comments of a user\n- Generates an LLM-backed psychological and stylistic persona\n- Cites exact URLs for every inferred trait\n- Clean CLI interface\n- Fully PEP-8 compliant code structure\n\n---\n\n## 🧰 Technologies Used\n\n- Python 3.10+\n- [PRAW](https://praw.readthedocs.io/en/stable/) – Reddit API wrapper\n- [Google Gemini API](https://ai.google.dev/)\n- `python-dotenv` for secure environment variable management\n\n---\n\n## 🔧 Setup Instructions\n\n### 1. Clone this repository\n\n```bash\ngit clone https://github.com/your-username/reddit-user-persona-generator.git\ncd RedditMindMap\n````\n\n### 2. Install dependencies\n\nWe recommend using a virtual environment:\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n---\n\n### 3. Setup `.env` file\n\nCreate a `.env` file in the project root directory with the following content:\n\n```env\n# Reddit API (Create from https://www.reddit.com/prefs/apps)\nREDDIT_CLIENT_ID=your_reddit_client_id\nREDDIT_CLIENT_SECRET=your_reddit_client_secret\n\n# Gemini API (Get from https://ai.google.dev/)\nGOOGLE_API_KEY=your_google_gemini_api_key\n```\n\n---\n## 🧪 How to Run\n\nYou can run the script in two ways:\n\n### **Option 1 – With a Reddit Profile URL as an Argument**\n\n```bash\npython main.py https://www.reddit.com/user/kojied/\n```\n\n### **Option 2 – Run Without Arguments (Interactive Mode)**\n\n```bash\npython main.py\n```\n\nYou will be prompted to enter a Reddit profile URL or just the username.\n\n---\n\n### 💡 What Happens When You Run It:\n\n1. Extracts the username from the provided URL (or direct input).\n2. Scrapes up to **30 posts** and **30 comments** using the Reddit API.\n3. Uses **Google Gemini LLM** to generate a structured persona.\n4. Saves the output in two formats:\n\n   * 📄 `kojied_persona.txt` (text-based for terminal and evaluation)\n   * 📝 `kojied_persona.md` (Markdown-formatted for GitHub)\n\n---\n\n## 📁 Example Output\n\nEach persona file (`.txt` and `.md`) includes:\n\n* 🎯 **Interests**\n* 🤔 **Personality traits**\n* 🗣️ **Tone of writing**\n* 👨‍🎓 **Possible profession or education**\n* 😂 **Language style or humor**\n* 🌎 **Political/social leanings (if any)**\n* 🚫 **Limitations**\n* 🔗 **Citations** for each trait (Reddit post or comment URL)\n* 💬 (Optional) **Representative quote**\n* ✅ (Optional) **Goals and needs**\n\n---\n\n## 📦 File Structure\n\n```plaintext\nreddit-user-persona-generator/\n│\n├── main.py                     # Entry point for CLI or prompt-based input\n├── persona_utils.py            # All scraping, LLM generation, saving logic\n├── requirements.txt            # Python dependencies\n├── .env                        # Stores API keys (excluded from Git)\n├── kojied_persona.txt          # Sample output (text format)\n├── kojied_persona.md           # Sample output (Markdown format)\n├── Hungry-Move-6603_persona.txt\n├── Hungry-Move-6603_persona.md\n└── README.md                   # README file\n```\n---\n\n## ✅ PEP-8 Compliant\n\nAll code follows PEP-8 standards for style and formatting. Verified using:\n\n```bash\nflake8 main.py persona_utils.py\n```\n\n---\n\n## 📌 Notes\n\n* Ensure your Reddit app is created as a **script app**, not web or installed.\n* If Gemini API throws a quota error, try reducing post/comment limit or use a smaller model.\n* Only public Reddit data is used; no login or upvote activity is tracked.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashmit-kumar%2Fredditmindmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashmit-kumar%2Fredditmindmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashmit-kumar%2Fredditmindmap/lists"}