Skip to main content

A simple command line tool to find and explore GitHub repositories through stargazers for a given repository.

Project description

Starred Repo Finder

A simple command line tool to find and explore GitHub repositories through stargazers for a given repository.

Features:

  • Find all repositories that are starred by the stargazers of a given repository
  • Filter results by minimum number of stargazers, forkers, and ratio of stargazers to forkers
  • Order results by stargazers, forkers, and ratio of stargazers to forkers
  • Output results in table, CSV, JSON, and markdown formats
  • Uses the GitHub Events Dataset and ClickHouse to query the data

Installation

Using uv (recommended):

uv pip install starred-repo-finder --upgrade

Or with pip:

pip install starred-repo-finder --upgrade

Usage

Command line usage:

$ starred_repo_finder --help
usage: starred_repo_finder [-h] [-l LIMIT]
                           [-o {stargazers,forkers,ratio}]
                           [-s STARGAZERS] [-f FORKERS] [-r RATIO]
                           [-fmt {table,csv,json,markdown}]
                           repo_name

positional arguments:
  repo_name             The repository name like`<owner>/<repo>`

options:
  -h, --help            show this help message and exit
  -l LIMIT, --limit LIMIT
                        The maximum number of results to return
                        (default: 100)
  -o {stargazers,forkers,ratio}, --order {stargazers,forkers,ratio}
                        Column to order by (default: stargazers).
                        Options: stargazers, forkers, ratio
  -s STARGAZERS, --stargazers STARGAZERS
                        Minimum number of stargazers to include
                        (default: None)
  -f FORKERS, --forkers FORKERS
                        Minimum number of forkers to include
                        (default: None)
  -r RATIO, --ratio RATIO
                        Minimum ratio of stargazers to forkers to
                        include (default: None)
  -fmt {table,csv,json,markdown}, --format {table,csv,json,markdown}
                        Output format (default: table). Options:
                        table, csv, json, markdown

Flask app usage:

Using uv:

uv pip install starred-repo-finder --upgrade

Or with pip:

pip install starred-repo-finder --upgrade

Once the package is installed, import and use the get_repos_starred_by_same_users() function in your Flask app like this:

from flask import Flask, jsonify, request
from starred_repo_finder import get_repos_starred_by_same_users

app = Flask(__name__)

@app.route('/starred_repo', methods=['GET', 'POST'])
def find_starred_repo():
    # check the request method
    if request.method == "POST":
        params = request.json
    else:
        params = request.args

    # repo_name is required
    repo_name = params.get("repo_name")
    if repo_name is None:
        return (
            jsonify({"error": "repo_name parameter is required"}),
            400,
        )

    # get the optional parameters or use the default values
    limit = int(params.get("limit", 10))
    order = params.get("order", "stargazers")

    # call the function from your package
    results, _ = get_repos_starred_by_same_users(repo_name, limit, order)

    # process the results as needed, here for instance we're sending them as JSON
    return jsonify(results)

Jupyter Notebook usage:

# in notebooks with uv available:
!uv pip install starred-repo-finder --upgrade
# or using the built-in Jupyter pip magic:
%pip install starred-repo-finder --upgrade

Once the package is installed, import and use the get_repos_starred_by_same_users() function in your Jupyter Notebook like this:

# Import necessary packages
from starred_repo_finder import get_repos_starred_by_same_users

# Define parameters
repo_name = 'vinta/awesome-python'
limit = 10
order = 'stargazers'

# Call the function
results, _ = get_repos_starred_by_same_users(repo_name, limit, order)

# Display the results
print(results)

Build & Test

Local development now uses uv for environment and dependency management.

  1. Install uv (macOS/Linux):
curl -LsSf https://astral.sh/uv/install.sh | sh
# then restart your shell so `uv` is on PATH
  1. Create and activate a virtual environment with uv:
uv venv  # creates .venv in the project
source ./.venv/bin/activate
  1. Install the project (editable) and test dependencies:
uv pip install -e . pytest
  1. Run tests:
pytest
# or
uv run pytest

Examples

Find the top 100 shared GitHub repositories by stars for stargazers of the Elderjs/elderjs repo:

$ starred_repo_finder Elderjs/elderjs

Screenshot

Find the top 10 shared GitHub repositories by stars for stargazers of the facebook/react repo, from repos with a minimum of 10,000 stargazers, 1,000 forkers, and a ratio of at least 10 stargazers to each forkers:

$ starred_repo_finder --limit=10 --order=ratio --stargazers=10000 --forkers=1000 --ratio=10 --format=markdown facebook/react
Project Stargazers Forkers Ratio
denoland/deno 23363 1016 23.0
typicode/json-server 22322 1013 22.04
GoogleChrome/puppeteer 21945 1057 20.76
nestjs/nest 20489 1077 19.02
flutter/flutter 34695 1838 18.88
jlevy/the-art-of-command-line 22344 1221 18.3
rust-lang/rust 21320 1178 18.1
996icu/996.ICU 21113 1173 18.0
thedaviddias/Front-End-Checklist 18298 1024 17.87
danistefanovic/build-your-own-x 20732 1209 17.15

Find the top 10 shared GitHub repositories by stars for stargazers of the pulumi/templates repo, using the default CLI rich table output format:

$ starred_repo_finder --limit=10 pulumi/templates

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┓
┃ Project                            Stargazers  Forkers  Ratio ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━┩
│  pulumi/templates                  63          6        10.5  │
│  pulumi/pulumi                     40          4        10.0  │
│  pulumi/examples                   34          5        6.8   │
│  kubernetes/kubernetes             28          6        4.67  │
│  localstack/localstack             25          3        8.33  │
│  ansible/ansible                   24          3        8.0   │
│  hashicorp/terraform               23          4        5.75  │
│  mingrammer/diagrams               23          0        N/A   │
│  kamranahmedse/developer-roadmap   22          3        7.33  │
│  GoogleCloudPlatform/terraformer   21          2        10.5  │
└───────────────────────────────────┴────────────┴─────────┴───────┘

Find the top 25 shared GitHub repositories by stars for stargazers of the theOehrly/Fast-F1 repo, from repos with a minimum of 5 forkers ordered by ratio in markdown format:

$ starred_repo_finder --limit=25 --order=ratio --forkers=5 --format=markdown theOehrly/Fast-F1
Project Stargazers Forkers Ratio
kamranahmedse/developer-roadmap 186 5 37.2
public-apis/public-apis 220 8 27.5
theOehrly/Fast-F1 1633 72 22.68
huggingface/transformers 128 6 21.33
sindresorhus/awesome 189 9 21.0
danistefanovic/build-your-own-x 164 8 20.5
airbnb/javascript 93 5 18.6
tiangolo/fastapi 128 7 18.29
trimstray/the-book-of-secret-knowledge 107 6 17.83
microsoft/PowerToys 141 8 17.62
donnemartin/system-design-primer 175 10 17.5
Genymobile/scrcpy 85 5 17.0
openai/gym 85 5 17.0
twitter/the-algorithm 118 7 16.86
3b1b/manim 134 8 16.75
pi-hole/pi-hole 98 6 16.33
CorentinJ/Real-Time-Voice-Cloning 79 5 15.8
supabase/supabase 110 7 15.71
sherlock-project/sherlock 93 6 15.5
vinta/awesome-python 170 11 15.45
strapi/strapi 77 5 15.4
microsoft/Web-Dev-For-Beginners 92 6 15.33
NationalSecurityAgency/ghidra 76 5 15.2
florinpop17/app-ideas 75 5 15.0

Write the top 100 shared GitHub repositories by stars for stargazers of the sveltejs/svelte repo to a CSV file:

$ starred_repo_finder --limit=100 --format=csv sveltejs/svelte > examples/sveltejs-svelte.csv

See examples/sveltejs-svelte.csv for the output.

Write the top 50 shared GitHub repositories by stars for stargazers of the duckdb/duckdb repo to a JSON file:

$ starred_repo_finder --limit=50 --format=json duckdb/duckdb > examples/duckdb-duckdb.json

See examples/duckdb-duckdb.json for the output.

Write the top 50 shared GitHub repositories by stars for stargazers of the Ionaru/easy-markdown-editor repo to a markdown file:

$ starred_repo_finder --limit=50 --format=markdown Ionaru/easy-markdown-editor > examples/ionaru-easy-markdown-editor.md

See examples/ionaru-easy-markdown-editor.md for the output.

Tools

Bump the version:

uvx bump2version minor

Acknowledgements

This would not be possible without the following:

Contributing

Contributions are welcome! Negative feedback is also welcome, but please be constructive. If you have a feature request, please open an issue first to discuss it. If you want to contribute code, please open an issue first to discuss it. If you want to contribute documentation, please open an issue first to discuss it. If you want to contribute an example, please open an issue first to discuss it. If you want to contribute a bug fix, please open an issue first to discuss it. If you want to contribute a test, please open an issue first to discuss it. If you want to contribute anything else, please open an issue first to discuss it. If you want to contribute a donation, please open an issue first to discuss it.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starred_repo_finder-1.7.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starred_repo_finder-1.7.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file starred_repo_finder-1.7.0.tar.gz.

File metadata

  • Download URL: starred_repo_finder-1.7.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for starred_repo_finder-1.7.0.tar.gz
Algorithm Hash digest
SHA256 02f2b35773356ad6cc6f8e8cb265103400ecda420feb2b2b21e0831b76f27c58
MD5 29b642a0e1b67f6508cd23686a9672a0
BLAKE2b-256 fd4ebe1a9fa13dce7492668cab7c68b5f643022ee0de904ebd65e4b4867b9576

See more details on using hashes here.

File details

Details for the file starred_repo_finder-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for starred_repo_finder-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f07dd9af12ee96d6563b5e2654c86b3b2ffec81c406986fad4a2d1e4e95ecc2a
MD5 c4ba9a17c771cf714e08f78189e0d683
BLAKE2b-256 e87a46adc1565c7a6270da26f68ffac4141ee9f15b9661d1422ac07e54d0a0fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page