Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbkane/starghaze
Save information about your GitHub starred repos into Google Sheets, Zinc, and SQLite!
https://github.com/bbkane/starghaze
cli data-visualisation fulltextsearch github github-stars go golang google-sheets homebrew zinc
Last synced: about 1 month ago
JSON representation
Save information about your GitHub starred repos into Google Sheets, Zinc, and SQLite!
- Host: GitHub
- URL: https://github.com/bbkane/starghaze
- Owner: bbkane
- License: mit
- Created: 2021-12-06T05:30:53.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-28T04:38:28.000Z (8 months ago)
- Last Synced: 2024-10-25T04:22:18.187Z (about 2 months ago)
- Topics: cli, data-visualisation, fulltextsearch, github, github-stars, go, golang, google-sheets, homebrew, zinc
- Language: Go
- Homepage:
- Size: 528 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - bbkane/starghaze - Save information about your GitHub starred repos into Google Sheets, Zinc, and SQLite! (Go)
README
# stargaze
Save information about your GitHub starred repos into Google Sheets, Zinc, and SQLite!
Thanks to https://github.com/yks0000/starred-repo-toc for the inspiration!
GraphQL and Google Sheets auth notes at [./dev_notes.md](./dev_notes.md)
## Install
- [Homebrew](https://brew.sh/): `brew install bbkane/tap/starghaze`
- [Scoop](https://scoop.sh/):```
scoop bucket add bbkane https://github.com/bbkane/scoop-bucket
scoop install bbkane/starghaze
```- Download Mac/Linux/Windows executable: [GitHub releases](https://github.com/bbkane/starghaze/releases)
- Go: `go install go.bbkane.com/starghaze@latest`
- Build with [goreleaser](https://goreleaser.com/) after cloning: `goreleaser --snapshot --skip-publish --rm-dist`## Download GitHub Stars
### Download Star Info
```bash
GITHUB_TOKEN=my_github_token starghaze download \
--include-readmes true \
--output stars.jsonl
```## Google Sheets
### Format Downloaded Stars as CSV
````bash
starghaze format \
--format csv \
--include-readmes false \
--output stars.csv
````### Upload CSV to Google Sheets
```bash
GOOGLE_APPLICATION_CREDENTIALS=/path/to/keys.json starghaze gsheets upload \
--csv-path stars.csv \
--sheet-id 0 \
--spreadsheet-id 15AXUtql31P62zxvEnqxNnb8ZcCWnBUYpROAsrtAhOV0 \
--timeout 30s
```### Analyze Away!
**Click here to see [My GitHub Stars Google Sheet](https://docs.google.com/spreadsheets/d/15AXUtql31P62zxvEnqxNnb8ZcCWnBUYpROAsrtAhOV0/edit?usp=sharing)**
![star-count-over-time.png](./star-count-over-time.png)
## Save Stars to [Zinc](https://github.com/prabhatsharma/zinc)
### Format Downloaded Stars as Zinc
```bash
starghaze format \
--include-readmes true \
--format zinc \
--output stars.zinc \
--zinc-index-name starghaze
```### Upload to Zinc
Using default settings - See [Zinc repo](https://github.com/prabhatsharma/zinc) for more details.
```bash
curl http://localhost:4080/api/_bulk -i -u admin:Complexpass#123 --data-binary "@stars.zinc"
```### Search!
![starghaze-zinc.png](starghaze-zinc.png)
## SQLite
### Format Downloaded Stars to SQLite (with [full text](https://www.sqlite.org/fts5.html) search)
```bash
starghaze format \
--format sqlite \
--include-readmes true \
--sqlite-dsn starghaze.db
```### Query!
For example, find the top 10 languages (as measured by number of repos) in the starred collection.
```bash
$ sqlite3 starghaze.db '
SELECT
l.Name ,
COUNT(lr.Language_id) as Repo_Count
FROM
Language_Repo lr JOIN Language l ON lr.Language_id = l.id
GROUP BY Language_id
ORDER BY Repo_Count DESC
LIMIT 10
'
-- Loading resources from /Users/bbkane/.sqliterc
┌────────────┬────────────┐
│ Name │ Repo_Count │
├────────────┼────────────┤
│ Shell │ 939 │
│ JavaScript │ 617 │
│ HTML │ 598 │
│ Python │ 540 │
│ Makefile │ 519 │
│ CSS │ 432 │
│ Dockerfile │ 403 │
│ Go │ 367 │
│ C │ 305 │
│ C++ │ 230 │
└────────────┴────────────┘
```