Skip to main content

Fetch and track GitHub stargazers and followers

Reason this release was yanked:

Mistakenly uploaded

Project description

watchy

PyPI version

Python library and CLI tool for fetching and tracking GitHub stargazers and followers.

See ryan-williams/.watchy for an example daily GHA that polls for stargazers and followers of a few orgs and repos.

Features

  • Fetch stargazers for GitHub repositories
  • Fetch followers for GitHub users or organizations
  • Save data to simple text files (one username per line)

Installation

pip install watchy

Usage

Command Line Interface

Fetch Repository Stargazers

# Single repository
watchy stars owner/repo

# Multiple repositories
watchy stars owner/repo1 owner/repo2 another-user/repo3

# All repositories for a user/org
watchy stars username
watchy stars orgname

# Mixed targets
watchy stars owner/repo username orgname

Fetch User/Organization Followers

# Single user
watchy follows username

# Multiple users
watchy follows user1 user2 user3

# Mix users and orgs
watchy follows user1 orgname user2

Output

watchy always:

  • saves usernames to text files under .watchy/ (configurable with $WATCHY_DIR)
  • prints usernames to stdout (first 5, ..., last 5 if >10 total)
  • shows counts in log messages (to stderr)

File locations:

  • Stargazers: .watchy/github/stars/<owner>/<repo>.txt
  • Followers: .watchy/github/follows/<user>.txt

Example output:

42 stargazers for owner/repo
alice
bob
charlie
david
emily
...
user38
user39
user40
user41
user42

Authentication

watchy automatically loads GitHub tokens from:

  1. --token command line argument
  2. GITHUB_TOKEN environment variable
  3. .token file in current directory
  4. gh auth token (GitHub CLI)
# Using environment variable
export GITHUB_TOKEN=your_personal_access_token
watchy stars owner/repo

# Using command line argument
watchy --token your_token stars owner/repo

# Using .token file
echo "your_token" > .token
watchy stars owner/repo

# Using GitHub CLI (if logged in)
gh auth login
watchy stars owner/repo  # Automatically uses gh token

Rate Limiting

# Add delay between requests when fetching multiple repos
watchy stars myorg -s 1.0  # 1 second delay between repos

Python API

from watchy.github import GitHubClient
from watchy.storage import save_logins_to_txt
from pathlib import Path

# Create client (auto-detects token)
client = GitHubClient()

# Fetch stargazers
stargazers = list(client.get_stargazers("owner", "repo"))
logins = save_logins_to_txt(iter(stargazers), Path("stargazers.txt"))

# Fetch followers
followers = list(client.get_followers("username"))

Development

# Install with dev dependencies
pip install -e .[dev]

# Lint
ruff check src/watchy/

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

watchy-0.0.6.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

watchy-0.0.6-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file watchy-0.0.6.tar.gz.

File metadata

  • Download URL: watchy-0.0.6.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for watchy-0.0.6.tar.gz
Algorithm Hash digest
SHA256 bf3069cdea949fe6549a52d33a028d85de739c1ace7c5956a38320ed71866da0
MD5 d07668f49d1f4c13ee4365cd8ddaf9be
BLAKE2b-256 e11ee14c64bfc20c69f10d42c7622e70ae2a5722df07a3c5ba0ef491c955eea9

See more details on using hashes here.

File details

Details for the file watchy-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: watchy-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for watchy-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 31b8e6c13e07696931790dfa8ed67aca451842acc4f10049e9f8fc61c5de4c75
MD5 fc8c5aa927e743470996ccc44492791e
BLAKE2b-256 2d8f7b8f744d27858024f45d8319462702132c3025bbcb6fe838c7e755ea3cff

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