{"id":30694241,"url":"https://github.com/trinhminhtriet/github-toolkit","last_synced_at":"2025-09-02T06:04:58.589Z","repository":{"id":285213153,"uuid":"957407118","full_name":"trinhminhtriet/github-toolkit","owner":"trinhminhtriet","description":"github-toolkit: Scrapes GitHub developers, followers, repositories into MySQL database.","archived":false,"fork":false,"pushed_at":"2025-08-21T18:04:32.000Z","size":47,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-21T21:08:19.736Z","etag":null,"topics":["github-user"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinhminhtriet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-30T09:44:41.000Z","updated_at":"2025-08-21T18:04:35.000Z","dependencies_parsed_at":"2025-08-13T15:28:38.602Z","dependency_job_id":"9c25d7fa-206b-4150-8018-d0fb87ac9ffe","html_url":"https://github.com/trinhminhtriet/github-toolkit","commit_stats":null,"previous_names":["trinhminhtriet/github-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trinhminhtriet/github-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgithub-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgithub-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgithub-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgithub-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinhminhtriet","download_url":"https://codeload.github.com/trinhminhtriet/github-toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgithub-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273238777,"owners_count":25069765,"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-09-02T02:00:09.530Z","response_time":77,"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":["github-user"],"created_at":"2025-09-02T06:04:57.980Z","updated_at":"2025-09-02T06:04:58.559Z","avatar_url":"https://github.com/trinhminhtriet.png","language":"Python","readme":"# 🚀 GitHub toolkit\n\nA Python-based web scraper that collects GitHub developer information, their followers, and repository details using Selenium and stores the data in a MySQL database.\n\n## ✨ Features\n\n- 🔥 Scrapes trending developers across multiple programming languages\n- 👥 Collects follower information (up to 1000 per developer)\n- 📦 Gathers repository details including name, URL, description, language, stars, and forks\n- 🔐 Supports authentication via cookies or username/password\n- 🗄️ Stores data in a MySQL database with automatic schema creation\n- ⚠️ Includes error handling and logging\n- 🧩 Follows clean architecture principles\n\n## 🗂️ Project Structure\n\n```\ngithub-toolkit/\n├── config/\n│   └── settings.py           # Configuration and environment variables\n├── core/\n│   ├── entities.py          # Domain entities\n│   └── exceptions.py        # Custom exceptions\n├── infrastructure/\n│   ├── database/           # Database-related code\n│   │   ├── connection.py\n│   │   └── models.py\n│   └── auth/              # Authentication service\n│       └── auth_service.py\n├── services/\n│   └── scraping/          # Scraping services\n│       ├── github_developer_scraper.py\n│       └── github_repo_scraper.py\n├── utils/\n│   └── helpers.py         # Utility functions\n├── controllers/\n│   └── github_scraper_controller.py  # Main controller\n├── main.py                # Entry point\n└── README.md\n```\n\n## 🛠️ Prerequisites\n\n- 🐍 Python 3.8+\n- 🗄️ MySQL database\n- 🌐 Chrome browser\n- 🧰 Chrome WebDriver\n\n## ⚙️ Installation\n\n1. Clone the repository:\n```bash\ngit clone git@github.com:trinhminhtriet/github-toolkit.git\ncd github-toolkit\n```\n\n2. Create a virtual environment and activate it:\n```bash\npython3 -m venv .venv\nsource ~/.venv/bin/activate\n```\n\n3. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n4. Create a `.env` file in the root directory with the following variables:\n```\nGITHUB_USERNAME=your_username\nGITHUB_PASSWORD=your_password\nDB_USERNAME=your_db_username\nDB_PASSWORD=your_db_password\nDB_HOST=your_db_host\nDB_NAME=your_db_name\n```\n\n5. Create a `config` directory:\n```bash\nmkdir config\n```\n\n## 📋 Requirements\n\nCreate a `requirements.txt` file with:\n```\nselenium\nsqlalchemy\npython-dotenv\n```\n\n## ▶️ Usage\n\nRun the scraper:\n```bash\ncd src\npython main.py\n```\n\nThe scraper will:\n1. 🔑 Authenticate with GitHub\n2. 🌟 Scrape trending developers for specified languages\n3. 👥 Collect their followers (up to 1000 per developer)\n4. 📦 Scrape their repositories\n5. 💾 Store all data in the MySQL database\n\n## ⚙️ Configuration\n\n- Modify `config/settings.py` to change:\n  - `LANGUAGES`: List of programming languages to scrape\n  - `USE_COOKIE`: Toggle between cookie-based and credential-based authentication\n- ⏱️ Adjust sleep times in services if needed for rate limiting\n\n## 🗃️ Database Schema\n\n### github_users\n- 🆔 id (PK)\n- 👤 username (unique)\n- 🔗 profile_url\n- 🕒 created_at\n- 🕒 updated_at\n- 📅 published_at\n\n### github_repos\n- 🆔 id (PK)\n- 👤 username\n- 📦 repo_name\n- 📝 repo_intro\n- 🔗 repo_url (unique)\n- 🏷️ repo_lang\n- ⭐ repo_stars\n- 🍴 repo_forks\n- 🕒 created_at\n- 🕒 updated_at\n- 📅 published_at\n\n## 🛡️ Error Handling\n\n- ❗ Custom exceptions for authentication, scraping, and database operations\n- 📝 Logging configured at INFO level\n- 🛑 Graceful shutdown of browser instance\n\n## 🤝 Contributing\n\n1. Fork the repository.\n2. Create a feature branch (`git checkout -b feature/your-feature`).\n3. Commit changes (`git commit -m \"Add your feature\"`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Open a pull request.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details (create one if needed).\n\n## 🙏 Acknowledgments\n\n- Built with [Selenium](https://www.selenium.dev/), [SQLAlchemy](https://www.sqlalchemy.org/), and [Python](https://www.python.org/).\n- Inspired by the need to automate GitHub data collection.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinhminhtriet%2Fgithub-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinhminhtriet%2Fgithub-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinhminhtriet%2Fgithub-toolkit/lists"}