This project provides a command-line tool that searches GitHub repositories while excluding those that have already been starred and therefore reviewed for OpenSustain.tech by the Ly0n account. It uses the GitHub REST API and supports advanced GitHub search syntax, sorting, filtering, and CSV export.
- Run advanced GitHub search queries (e.g.
in:readme "climate change" stars:>5) - Sort results by most recently updated
- Exclude repositories starred by a specific user (default: yourself)
- Exclude repositories owned by a specific user
- Limit the maximum number of repositories returned
- Export results to CSV
- Python 3.8 or newer
- A GitHub Personal Access Token (classic)
-
Clone the repository
git clone git@github.com:protontypes/opensustain.investigator.git
-
Install dependencies:
pip install requests
-
Create a GitHub Personal Access Token:
- Go to GitHub Settings → Developer settings → Personal access tokens
- Generate a classic token with at least the
public_reposcope
python3 github_filtered_search.py \
--token ghp_XXXX \
--username lyon \
--query 'in:readme "climate change" stars:>5' \
--csv climate_results.csv \
--exclude-starred-user ly0n \
--max 50-
--tokenGitHub Personal Access Token -
--usernameYour GitHub username (for identification) -
--queryGitHub repository search query -
--csvOutput CSV file name -
--exclude-ownerExclude repositories owned by a specific user -
--exclude-starred-user USERExclude repositories starred by another user (default: your username). -
--maxMaximum number of repositories to return
The generated CSV file contains the following columns:
- Repository name (
owner/repo) - Repository URL
- Description
- Star count
- Last updated timestamp
- Owner
- GitHub search results are limited to approximately 1,000 results per query by the GitHub API.
- Excluding starred repositories requires a valid and authorized token.
MIT License