Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nodiscc/github-stars-backup
[mirror] Backup a list of github starred repositories for the specified user.
https://github.com/nodiscc/github-stars-backup
backup export github stars
Last synced: 2 months ago
JSON representation
[mirror] Backup a list of github starred repositories for the specified user.
- Host: GitHub
- URL: https://github.com/nodiscc/github-stars-backup
- Owner: nodiscc
- License: mit
- Created: 2017-02-24T12:45:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-06T12:23:34.000Z (over 1 year ago)
- Last Synced: 2024-11-10T12:42:20.864Z (2 months ago)
- Topics: backup, export, github, stars
- Language: Python
- Homepage: https://gitlab.com/nodiscc/github-stars-backup
- Size: 61.5 KB
- Stars: 129
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - nodiscc/github-stars-backup - [mirror] Backup a list of github starred repositories for the specified user. (Python)
- jimsghstars - nodiscc/github-stars-backup - [mirror] Backup a list of github starred repositories for the specified user. (Python)
README
# github-stars-backup
Backup a list of github starred repositories for the specified user.
### Python version
- The python version requires that you generate a [Personal Access Token](https://github.com/settings/tokens) using one of the following methods:
- Create a "classic" token with the scope `read:user`.
- Or, use a new "fine-grained token" with the `Account Permissions` -> `Starring` -> `read-only` permission.
- The token must be exported to the `GITHUB_ACCESS_TOKEN` environment variable
- It outputs a JSON file containing the name, description, url, homepage, language number of open issues/stars of each starred repository
- The rate limit for authenticated API requests is 5000 requests/hour.#### Installation
```bash
# install requirements in a virtualenv
python3 -m venv ~/.local/venv
source ~/.local/venv/bin/activate
pip3 install PyGithub# clone the repository
git clone https://gitlab.com/nodiscc/github-stars-backup
cd github-stars-backup
```#### Usage
```bash
# all commands must be run from the virtualenv
source ~/.local/venv/bin/activate./github-stars-backup.py --help
USAGE: ./github-stars-backup.py USERNAME OUTPUT_FILE
GITHUB_ACCESS_TOKEN must be declared in the environment, see https://github.com/settings/tokensexport GITHUB_ACCESS_TOKEN=aaaabbbbccccddddeeefffggghhhiijjj
./github-stars-backup.py nodiscc github-stars-backup.json
``````json
$ cat github-stars-backup.json
{
"ayyi/samplecat": {
"name": "ayyi/samplecat",
"description": "SampleCat is a a program for cataloguing and auditioning audio samples.",
"url": "https://github.com/ayyi/samplecat",
"homepage": "http://ayyi.github.io/samplecat/",
"language": "C",
"open_issues": 15,
"stars": 33
},
...
}
```### Bash version (legacy)
- The (unmaintained) bash version does not require API authentication.
- It doesn't handle errors well, output will be wrong when the API rate limit is exceeded. The [rate limit](https://developer.github.com/v3/#rate-limiting) for unauthenticated requests is only 60 requests/hour.
- An intermediary JSON file containing the full API request results will be stored at `github-stars.json`
- The final output is a plain text list of starred repositories```bash
USAGE: ./github-stars-backup.sh USERNAME OUTPUT_FILE$ ./github-stars-backup.sh nodiscc github-stars.txt
$ cat github-stars.txt
```
```
https://github.com/eliasgranderubio/dagda
https://github.com/banyanops/collector
https://github.com/building5/ansible-vault-tools
...
```### License
[MIT](LICENSE)