Tool for crawling GitHub repositories, issues, and discussions based on keywords.
-
Clone the repository:
git clone https://github.com/damhuman/github-crawler.git cd github-crawler -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Run the crawler with an input JSON file:
python main.py data/input.jsonThe crawler supports the following options:
--output_file: Specify the output file path (default: "data/results.json")--extra_info: Include extra information in the output (default: False)
python main.py data/input.json --output_file data/results.json --extra_infoExample input JSON file:
{
"keywords": ["python", "data science"],
"proxies": ["127.0.0.1:8080"],
"type": "repositories"
}The crawler will save the results in the specified output file. The output format is as follows:
{
"keywords": ["python", "data science"],
"search_type": "repositories",
"results": [
{
"url": "https://github.com/user/repo",
"extra": {
"owner": "user",
"language_stats": {
"Python": 50,
"JavaScript": 30,
"HTML": 20
}
}
}
]
}To run the tests:
coverage coverage run -m unittest discover tests
coverage report -mTo view the coverage report:
coverage html