Skip to main content

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

stararchiver-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

stararchiver-1.0.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for stararchiver-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0d012736a4340f80798885156dcf819e97d36a30ba2f85f28724573f6dffd1b7
MD5 1a4cc1064ee16a1ecb7cf3bc3c011218
BLAKE2b-256 38c6bba67c7624a96c3b4ea0afa70850d2b59dbf13827e0a6cf70efe2217f3e1

See more details on using hashes here.

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

Hashes for stararchiver-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38c181ca723068e7816b0874ee7786aaeba4bdd4bbefa7280ccd7c8e37cd8e58
MD5 c991fcdc0926dec41378e83f99db3575
BLAKE2b-256 e4017cfc85637ba78e7a9640de6a793b6046935f5071464edfd44a345f430d90

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page