{"id":17531116,"url":"https://github.com/milosgajdos/orbnet","last_synced_at":"2025-04-23T20:25:07.853Z","repository":{"id":39660695,"uuid":"461994161","full_name":"milosgajdos/orbnet","owner":"milosgajdos","description":"GitHub stars network","archived":false,"fork":false,"pushed_at":"2025-04-17T06:56:02.000Z","size":2808,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T21:24:38.694Z","etag":null,"topics":["api","github","github-stars","go","golang","graph","network","stars"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milosgajdos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-21T19:00:27.000Z","updated_at":"2025-04-17T06:56:04.000Z","dependencies_parsed_at":"2022-09-20T07:51:59.264Z","dependency_job_id":"be863db7-5d86-4026-a79e-050b1116b21b","html_url":"https://github.com/milosgajdos/orbnet","commit_stats":{"total_commits":7,"total_committers":3,"mean_commits":"2.3333333333333335","dds":0.2857142857142857,"last_synced_commit":"2dd341a1c42ed2e391f720370b51076181eda0c6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"milosgajdos/go-repo-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milosgajdos%2Forbnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milosgajdos%2Forbnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milosgajdos%2Forbnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milosgajdos%2Forbnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milosgajdos","download_url":"https://codeload.github.com/milosgajdos/orbnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250507462,"owners_count":21441997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","github","github-stars","go","golang","graph","network","stars"],"created_at":"2024-10-20T17:22:54.374Z","updated_at":"2025-04-23T20:25:07.819Z","avatar_url":"https://github.com/milosgajdos.png","language":"Go","readme":"# orbnet: GitHub stars network\n\n[![Build Status](https://github.com/milosgajdos/orbnet/workflows/CI/badge.svg)](https://github.com/milosgajdos/orbnet/actions?query=workflow%3ACI)\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/milosgajdos/orbnet)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n`orbnet` is a collection of command line utilities that let you export your starred GitHub repositories as a Graph and serve it via a simple API.\n\nThere are the following command line utilties available in this repo:\n* `dumper`: dumps your GitHub stars as `JSON` blobs\n* `grapher`: reads the dumped `GitHub` star `JSON` blobs and builds a simple **Weighted Directed** [Graph](https://en.wikipedia.org/wiki/Graph_(discrete_mathematics))\n* `apisrv`: serves the graph over JSON API\n\n# Get started\n\nIf you have `nix` installed just run\n```shell\nnix build\n```\n\nor\n\n```shell\nnix develop\n```\n\nYou can also run individual commands which are provided as flake apps\n```shell\nnix run \".#apisrv\"\nnix run \".#dumper\"\nnix run \".#grapher\"\n```\n\nAlternatively, if you have the Go toolchain installed, you can build all binaries using the project `Makefile`:\n\n```shell\nmake cmd\n```\n\n`cmd` target fetches all dependencies, builds all binaries and places them into `_build` directory:\n\n```shell\n$ ls -1 ./_build\ndumper\ngrapher\napisrv\n```\n\n## HOWTO\n\nOnce the binaries have been built you can explore the available command line options using the familiar `-help` switch.\nThe below will demonstrate the basic usage of all project utilities.\n\n### Prerequisites\n\n\u003e [!IMPORTANT]\n\u003e Before you proceed furhter you must obtain a `GitHub` [API token](https://github.com/settings/tokens). Once you've got the token you must export it\n\u003e via an environment variable called `GITHUB_TOKEN` which is then automatically read by the project utilities.\n\nOptionally, I'd recommend installing [GraphViz](https://graphviz.org/) toolkit that helps exploring the results visually.\n\n### dumper: dump starred GitHub repos\n\nAs described earlier, `dumper` \"scrapes\" `GitHub` API stars data and dumps them into `JSON` blobs. The data are dumped into standard output by default,\nbut you can also store them in a directory of your choice by passing the path to the output directory via `-outdir` command line switch.\n\n\u003e [!NOTE]\n\u003e You can tune the number of API scrapers. By default only a single worker is spawned.\n\u003e See the output of `-help` for more info.\n\n```shell\n./dumper -user milosgajdos\n```\n\n\u003e [!NOTE]\n\u003e `foo` must exist before you run the command below!\n\n```shell\n./dumper -user milosgajdos -paging 100 -outdir foo/\n```\n\n### grapher: build a graph of GitHub stars\n\n`grapher` builds the graph from the dumped data. You can \"feed\" `grapher` either by passing the path to the directory that contains the `JSON` blobs\nvia `-indir` command line switch. Alternatively, you can also `pipe` the data to the `grapher` utility as by default it reads the data from standard input.\n\nBuilding an in-memory graph is kinda fun, but there is no point of it if you can't visualise the results. `grapher` provides `-marshal` and `-format`\ncommand line switches which let you export (marshal) the graph into various different data formats:\n* `Graphviz` (see [here](https://graphviz.org/doc/info/lang.html))\n* `SigmaJS` (see [here](http://sigmajs.org/))\n* `CytoscapeJS` (see [here](https://js.cytoscape.org/))\n* `networkx` (see [here](https://networkx.org/documentation/stable//reference/readwrite/json_graph.html))\n* `gexf` (see [here](https://gephi.org/gexf/format/))\n* `jsonapi` serializes the graph into `orbnet` API model\n\nLoad graph data from dumps directory and output it in GEXF format:\n```shell\n./grapher -marshal -indir foo/ -format gexf \u003e repos.gexf\n```\n\nPipe data from `dumper` to `grapher` and dump the graph into GEXF file:\n```shell\n./dumper -user milosgajdos | ./grapher -marshal -format gexf \u003e repos.gexf\n```\n\n\u003e [!NOTE]\n\u003e If your graph is large, `sfdp` command might take a while to complete\n\nBuild the graph, dumpt it into `dot` format and export it to SVG\n```shell\n./dumper -user milosgajdos -paging 100 | ./grapher -marshal -format dot | sfdp -Tsvg \u003e repos.svg\n```\n\nAlternatively you can run `dot` with overlay options that should build a better overlay of data:\n```\n./grapher -marshal -indir foo/ -format dot | sfdp -x -Goverlap=scale -Tpng \u003e repos.png\n```\n\n\u003e [!NOTE]\n\u003e `grapher` builds a *Weighted Directed Graph* that contains four types of nodes:\n\n* `owner`: the repo owner\n* `repo`: the name of the repo\n* `topic`: the repo topic\n* `lang`: the dominant programming language as returned by GitHub API\n\n### apisrv: serve the graph over a JSON API\n\n`apisrv` lets you serve the dumped graph over a JSON API. It even provides `swagger` docs on `/docs/` endpoint.\nYou can load the dumped graph via `-dsn _path_to_graph.json` cli switch.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilosgajdos%2Forbnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilosgajdos%2Forbnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilosgajdos%2Forbnet/lists"}