GitHub trending repositories CLI and library
Project description
GitHub Trending CLI
Fetch the most starred GitHub repositories created within a recent time window. Includes a CLI (ghtrend) and a small Python library.
Features
- Query “trending” repositories by creation date window (1w, 1m, 3m, 6m, 1y)
- Sorts by stars (descending)
- Simple CLI output
- Reusable Python API
Requirements
- Python 3.11+
Install
From source (recommended for now)
python -m venv .venv
source .venv/bin/activate
pip install -e .
CLI Usage
Once installed, run:
ghtrend --duration 1w --limit 10
Options
-d,--duration(default:1w)- Valid values:
1w,1m,3m,6m,1y
- Valid values:
-l,--limit(default:10)- Number of repositories to return
Example Output
octocat/Hello-World with 4242 stars, at url: https://github.com/octocat/Hello-World
Library Usage
from github_trending_cli.client import trending
repos = trending("1m", 5)
for repo in repos:
print(repo.full_name, repo.stars, repo.url)
Returned Model
trending() returns a list of Repo objects with:
full_name(str)stars(int)url(str)description(str | None)language(str | None)topics(tuple[str, ...])
Errors
The CLI exits with:
2on invalid duration or limit3on GitHub API errors
In library usage, errors are raised as:
InvalidDurationErrorInvalidLimitErrorGitHubAPIError
Development
Run tests:
pytest
Notes
-
This uses the public GitHub Search API. Unauthenticated requests are subject to GitHub’s rate limits.
-
It's initially a roadmap project: https://roadmap.sh/projects/github-trending-cli
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file github_trending_repos_api-0.1.1.tar.gz.
File metadata
- Download URL: github_trending_repos_api-0.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f3053d5c5459f188b73a8d2d8835f80150af5320e817f5d4440f3b8265105bb
|
|
| MD5 |
03824fb8d18e301a56ad7db400a1a621
|
|
| BLAKE2b-256 |
18e558e490388abbff1ac5994617e32fb5fb09223b839894fb5edbba8556fffa
|
File details
Details for the file github_trending_repos_api-0.1.1-py3-none-any.whl.
File metadata
- Download URL: github_trending_repos_api-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8de6d9f2fc5f6936f864248c8f03ff4c00207209b2f919f6ce6edf1bfd7cf9e6
|
|
| MD5 |
9badffbcf5b365d6619e3e3217aa1fe1
|
|
| BLAKE2b-256 |
39ba05ef624bb57743b371f107e3e58b4727e452be07806c8621dd35b51f666a
|