{"id":27135528,"url":"https://github.com/goccy/go-modrank","last_synced_at":"2025-04-08T01:48:27.928Z","repository":{"id":286094815,"uuid":"958937429","full_name":"goccy/go-modrank","owner":"goccy","description":"A tool to calculate the Go modules that are truly important to you","archived":false,"fork":false,"pushed_at":"2025-04-04T09:31:45.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T10:32:16.528Z","etag":null,"topics":["github","go","go-library","golang","gomod"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goccy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["goccy"]}},"created_at":"2025-04-02T02:21:40.000Z","updated_at":"2025-04-04T10:11:24.000Z","dependencies_parsed_at":"2025-04-04T10:42:46.846Z","dependency_job_id":null,"html_url":"https://github.com/goccy/go-modrank","commit_stats":null,"previous_names":["goccy/go-modrank"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goccy%2Fgo-modrank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goccy%2Fgo-modrank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goccy%2Fgo-modrank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goccy%2Fgo-modrank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goccy","download_url":"https://codeload.github.com/goccy/go-modrank/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761028,"owners_count":20991533,"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":["github","go","go-library","golang","gomod"],"created_at":"2025-04-08T01:48:27.225Z","updated_at":"2025-04-08T01:48:27.917Z","avatar_url":"https://github.com/goccy.png","language":"Go","funding_links":["https://github.com/sponsors/goccy"],"categories":[],"sub_categories":[],"readme":"# go-modrank\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/goccy/go-modrank)](https://pkg.go.dev/github.com/goccy/go-modrank)\n![Go](https://github.com/goccy/go-modrank/workflows/Go/badge.svg)\n\nA tool to identify the Go modules that truly matter to you\n\n# Motivation\n\nMost of us rely on open-source software (OSS) for our business. However, the OSS that is crucial to our business is not always properly recognized. For example, the number of GitHub stars is a useful metric for popularity, but it does not necessarily indicate how important a piece of software is to us.\n\nIf star counts were to increase according to importance, then libraries that applications and frameworks depend on should have more stars than the applications and frameworks themselves, which are closer to users. Unfortunately, this is not the case today.\n\nTo address this issue, I wanted to create a tool that quantitatively evaluates the importance of software, visualizes it, and connects it with other systems.\n\n# Use Case\n\nThis tool can score the Go software used by repositories associated with a specific GitHub organization. If you want to understand which Go-based software is critical to your organization, this tool will be useful.\n\nA special feature of this tool is that it retrieves repositories hosting Go modules, allowing you to identify which repositories are essential to your needs.\n\nSince this tool can also be used as a Go library, it can be applied to various other use cases, such as visualizing contributors to the repositories that are important to your organization.\n\n# Scoring Strategy\n\nThe most critical aspect of this tool is how it quantitatively evaluates importance. Below is an explanation of the scoring rules.\n\n## Assigning Scores to Repositories Based on Importance (Default: 1)\n\nOrganizations often contain repositories used for personal tool development as well as repositories used in production environments. The latter should be considered more important.\n\nIf your organization has a way to quantitatively assess repository importance, this tool allows you to reflect that value in its scoring.\n\n## Detecting go.mod and Retrieving Dependency Graphs\n\nThe tool clones repositories, navigates to paths containing go.mod, and executes `go mod graph`. It then analyzes the results to construct a dependency graph of Go modules. If multiple go.mod files are found, a graph will be created for each one.\n\n## Scoring Modules Based on the Dependency Graph\n\nModules that are not depended on by any other modules are called Root Modules. Their score is determined by the score assigned to their respective repositories.\n\nAs dependencies go deeper in the hierarchy, their score increases by 1 at each level. In other words, the modules located at the deepest level of the dependency hierarchy will have the highest scores.\n\nSince root modules correspond to paths containing go.mod files, modules used in multiple go.mod files will naturally have higher scores.\n\nIf a module is recursively referenced within the dependency graph, its score will not be counted.\n\n# Installation\n\nTo use this tool as a standalone application, run the following command:\n\n```console\ngo install github.com/goccy/go-modrank/cmd/go-modrank@latest\n```\n\nFor example, you can use the tool by executing the following command:\n\n```console\ngo-modrank run --repository https://github.com/goccy/go-modrank.git\n```\n\nFor more details, use the command help:\n\n```console\ngo-modrank -h\n```\n\n```console\nUsage:\n  main [OPTIONS] \u003crun | update\u003e\n\nHelp Options:\n  -h, --help  Show this help message\n\nAvailable commands:\n  run     Scan all repositories and output ranking data\n  update  Update repository status using the GitHub API to improve performance\n```\n\n# Prerequisites\n\nIn order to use the `go mod graph` command, you will need to have the Go binary installed in your execution environment.\n\n# Synopsis\n\nTo use this tool as a library, you can follow the example below. By default, SQLite is used for data storage, but other databases can also be used. The behavior can be fine-tuned using options. For more details, refer to the API Reference.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/goccy/go-modrank\"\n\t\"github.com/goccy/go-modrank/repository\"\n)\n\nfunc main() {\n\tif err := run(context.Background()); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ctx context.Context) error {\n\tr, err := modrank.New(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\trepo, err := repository.New(\"https://github.com/goccy/go-modrank.git\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmods, err := r.Run(ctx, repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor idx, mod := range mods {\n\t\tfmt.Printf(\"- [%d] %s (%s): %d\\n\", idx+1, mod.Name, mod.Repository, mod.Score)\n\t}\n\treturn nil\n}\n```\n\n# Features\n\n- Concurrent Scanning\n  - You can specify workers to enable concurrent processing\n- Interruptible\n  - By analyzing while saving scan results to the database, already searched items can be skipped even if the process is interrupted\n- Efficient API Calls Considering GitHub API Rate Limits\n- Automatically detects repositories hosting Go modules and includes them in the results\n\n# License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoccy%2Fgo-modrank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoccy%2Fgo-modrank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoccy%2Fgo-modrank/lists"}