stararchiver
Current version: 1.0.0
What does it do?
Given a GitHub username, stararchiver looks up every repository that user has starred via the GitHub REST API, clones them all to disk, and optionally compresses them into a single zip file.
stararchiver_<username>_<timestamp>/
author1-repo1/
author1-repo2/
...
author2-repo3/
Requirements
- Python 3.9+
git(required)- Internet access to
api.github.com
Python's built-in zipfile module is used for compression, so no external zip binary is needed.
Install
pip install stararchiver
Usage
stararchiver <github-username>
Clone over SSH
By default repositories are cloned over HTTPS, which works without any extra setup. To clone over SSH (requires an SSH key registered with GitHub):
stararchiver <github-username> --ssh
Compress repositories into a single zip file
stararchiver <github-username> -c
Optionally delete the cloned data afterwards (the zip is kept):
stararchiver <github-username> -c -d
Specify the output directory
stararchiver <github-username> -o ~/starred_repos
Provide a GitHub token
The unauthenticated GitHub API allows 60 requests/hour. Starred-list pagination consumes roughly one request per 100 stars, so long star lists hit that ceiling quickly. Passing a token raises the limit to 5,000 requests/hour.
Either pass it explicitly or export it in your environment (recommended, so it never ends up in your shell history):
export GITHUB_TOKEN=ghp_xxx
stararchiver <github-username>
# equivalent:
stararchiver <github-username> -t ghp_xxx
Both fine-grained and classic personal access tokens are supported. Tokens only
need public read access; no scopes beyond public data are required.
Other options
| Flag | Description |
|---|---|
-j, --jobs N |
Clone up to N repositories concurrently (default 4) |
--shallow |
Shallow-clone each repo (--depth 1) to save space and time |
--no-wiki |
Don't clone each repository's wiki |
--metadata |
Write a starred_repos.json manifest describing every repo |
--max-repos N |
Only archive the first N starred repos (handy for testing) |
--dry-run |
Print the starred repos without cloning anything |
-v, --version |
Show the version and exit |
Full details are always available via stararchiver -h.
pip packaging
View the stararchiver package on PyPI.
Build a new pip package
./build.sh
Upload a new package to PyPI
./update-pip.sh
Development
Run straight from a checkout (no install needed). The only dependency is
requests.
On Homebrew-managed Python, pip refuses to install packages outside a
virtual environment (PEP 668), so create
one first:
python3 -m venv ~/.venvs/stararchiver
source ~/.venvs/stararchiver/bin/activate
pip install requests
./stararchiver <github-username> --dry-run
Alternatively, install the stararchiver command itself from the local
checkout with pipx (no PyPI upload needed):
brew install pipx
pipx install .
stararchiver <github-username> --dry-run
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 stararchiver-1.0.0.tar.gz.
File metadata
- Download URL: stararchiver-1.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d012736a4340f80798885156dcf819e97d36a30ba2f85f28724573f6dffd1b7
|
|
| MD5 |
1a4cc1064ee16a1ecb7cf3bc3c011218
|
|
| BLAKE2b-256 |
38c6bba67c7624a96c3b4ea0afa70850d2b59dbf13827e0a6cf70efe2217f3e1
|
File details
Details for the file stararchiver-1.0.0-py3-none-any.whl.
File metadata
- Download URL: stararchiver-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c181ca723068e7816b0874ee7786aaeba4bdd4bbefa7280ccd7c8e37cd8e58
|
|
| MD5 |
c991fcdc0926dec41378e83f99db3575
|
|
| BLAKE2b-256 |
e4017cfc85637ba78e7a9640de6a793b6046935f5071464edfd44a345f430d90
|