{"id":13458762,"url":"https://github.com/google/mug","last_synced_at":"2026-03-14T08:14:53.989Z","repository":{"id":38805841,"uuid":"81968413","full_name":"google/mug","owner":"google","description":"A small Java 8 library (string manipulation, BiStream, Structured Concurrency, SQL Templates)","archived":false,"fork":false,"pushed_at":"2026-02-08T05:28:39.000Z","size":91474,"stargazers_count":468,"open_issues_count":2,"forks_count":80,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-02-08T12:59:25.704Z","etag":null,"topics":["java-string","parser-combinator","parser-combinators","sql","sql-injection-proof","stream-api","streams","string-manipulation","structured-concurrency"],"latest_commit_sha":null,"homepage":"","language":"Java","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/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-02-14T17:01:43.000Z","updated_at":"2026-02-08T05:25:25.000Z","dependencies_parsed_at":"2026-02-01T03:11:20.291Z","dependency_job_id":null,"html_url":"https://github.com/google/mug","commit_stats":null,"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/google/mug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fmug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fmug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fmug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fmug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/mug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fmug/sbom","scorecard":{"id":437495,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/mug","commit":"ec9a69548caedace8597e94aad689e6bacda579e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":10,"reason":"SAST tool detected: CodeQL","details":["Info: SAST configuration detected: CodeQL","Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/google/mug/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/google/mug/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/google/mug/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:87: update your workflow using https://app.stepsecurity.io/secureworkflow/google/mug/codeql-analysis.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T05:01:14.470Z","repository_id":38805841,"created_at":"2025-08-19T05:01:14.470Z","updated_at":"2025-08-19T05:01:14.470Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29457941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T21:29:27.764Z","status":"ssl_error","status_checked_at":"2026-02-14T21:28:11.111Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["java-string","parser-combinator","parser-combinators","sql","sql-injection-proof","stream-api","streams","string-manipulation","structured-concurrency"],"created_at":"2024-07-31T09:00:56.958Z","updated_at":"2026-02-14T22:08:01.244Z","avatar_url":"https://github.com/google.png","language":"Java","readme":"Disclaimer: This is not an official Google product.\n\n# Mug (![Coverage](.github/badges/mug-coverage.svg))\nA small Java 8+ string processing and streams library ([javadoc](http://google.github.io/mug/apidocs/index.html)), widely used in Google's internal Java codebase, with **0 deps** (Proto, BigQuery, Guava addons are in separate artifacts). ![](https://travis-ci.org/google/mug.svg?branch=master)\n\n## Highlights\n\n- ✅ [`Substring`](https://github.com/google/mug/wiki/Substring-Explained) – composable substring extraction \u0026 manipulation  \n  → `Substring.between(\"(\", \")\").from(\"call(foo)\") → \"foo\"`\n- ✅ [`StringFormat`](https://github.com/google/mug/wiki/StringFormat-Explained) – compile-time-safe bidirectional parsing/formatting  \n  → `new StringFormat(\"/home/{user}/{date}\").parse(filePath, (user, date) -\u003e ...)`\n- ✅ [`Parser`](https://google.github.io/mug/apidocs/com/google/common/labs/parse/Parser.html) – no more regex  \n  → `zeroOrMore(noneOf(\"\\\\'\")).immediatelyBetween(\"'\", \"'\").parse(input);`\n- ✅ [`BiStream`](./mug/src/main/java/com/google/mu/util/stream/README.md) – streams `Map` and pair-wise collections  \n  → `BiStream.zip(keys, values).toMap()`\n- ✅ [`SafeSql`](./mug-safesql/src/main/java/com/google/mu/safesql/README.md) – _library-enforced_ **safe**, **composable** SQL template  \n  → ```SafeSql.of(\"select id, `{col}` from Users where id = {id}\", col, id)```\n\n\u003cdetails\u003e\n\u003csummary\u003eMore tools\u003c/summary\u003e\n \n- [`DateTimeFormats`](./mug/src/main/java/com/google/mu/time/README.md) – parse datetimes by example  \n  → `DateTimeFormatter format = formatOf(\"2024-03-14 10:00:00.123 America/New_York\")`\n- [`Iteration`](./mug/wiki/Iteration-Explained) - implement lazy stream with recursive code\n- [`BinarySearch`](./mug-guava/src/main/java/com/google/guava/labs/collect/README.md) - solve LeetCode binary search problems  \n  → `BinarySearch.inSortedArrayWithTolerance(doubleArray, 0.0001).find(target)`\n- [`StructuredConcurrency`](./mug/src/main/java/com/google/mu/util/concurrent/README.md) - simple structured concurrency on virtual threads  \n  → `concurrently(() -\u003e fetchArm(), () -\u003e fetchLeg(), (arm, leg) -\u003e makeRobot(arm, leg))`\n- [`MoreStreams`](./mug/apidocs/com/google/mu/util/stream/MoreStreams.html)  \n  → `whileNotNull(queue::poll).filter(...).map(...)`\n- [`Optionals`](./mug/apidocs/com/google/mu/util/Optionals.html)  \n  → `return optionally(obj.hasFoo(), obj::getFoo);`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstallation\u003c/summary\u003e\n\n##### Maven\n\nAdd the following to pom.xml:\n```\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.google.mug\u003c/groupId\u003e\n    \u003cartifactId\u003emug\u003c/artifactId\u003e\n    \u003cversion\u003e9.9.2\u003c/version\u003e\n  \u003c/dependency\u003e\n```\n\nAdd `mug-errorprone` to your annotationProcessorPaths:\n\n```\n  \u003cbuild\u003e\n    \u003cpluginManagement\u003e\n      \u003cplugins\u003e\n        \u003cplugin\u003e\n          \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n          \u003cconfiguration\u003e\n            \u003cannotationProcessorPaths\u003e\n              \u003cpath\u003e\n                \u003cgroupId\u003ecom.google.errorprone\u003c/groupId\u003e\n                \u003cartifactId\u003eerror_prone_core\u003c/artifactId\u003e\n                \u003cversion\u003e2.23.0\u003c/version\u003e\n              \u003c/path\u003e\n              \u003cpath\u003e\n                \u003cgroupId\u003ecom.google.mug\u003c/groupId\u003e\n                \u003cartifactId\u003emug-errorprone\u003c/artifactId\u003e\n                \u003cversion\u003e9.9.2\u003c/version\u003e\n              \u003c/path\u003e\n            \u003c/annotationProcessorPaths\u003e\n          \u003c/configuration\u003e\n        \u003c/plugin\u003e\n      \u003c/plugins\u003e\n    \u003c/pluginManagement\u003e\n  \u003c/build\u003e\n```\nSafeSql ([javadoc](https://google.github.io/mug/apidocs/com/google/mu/safesql/package-summary.html)):\n```\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.google.mug\u003c/groupId\u003e\n    \u003cartifactId\u003emug-safesql\u003c/artifactId\u003e\n    \u003cversion\u003e9.9.2\u003c/version\u003e\n  \u003c/dependency\u003e\n```\n\n\nDot Parse Combinators ([javadoc](https://google.github.io/mug/apidocs/com/google/common/labs/parse/package-summary.html)):\n```\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.google.mug\u003c/groupId\u003e\n    \u003cartifactId\u003edot-parse\u003c/artifactId\u003e\n    \u003cversion\u003e9.9.2\u003c/version\u003e\n  \u003c/dependency\u003e\n```\n\nProtobuf utils ([javadoc](https://google.github.io/mug/apidocs/com/google/mu/protobuf/util/package-summary.html)):\n```\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.google.mug\u003c/groupId\u003e\n    \u003cartifactId\u003emug-protobuf\u003c/artifactId\u003e\n    \u003cversion\u003e9.9.2\u003c/version\u003e\n  \u003c/dependency\u003e\n```\n\n##### Gradle\n\nAdd to build.gradle:\n```\n  implementation 'com.google.mug:mug:9.9.2'\n  implementation 'com.google.mug:mug-safesql:9.9.2'\n  implementation 'com.google.mug:dot-parse:9.9.2'\n  implementation 'com.google.mug:mug-guava:9.9.2'\n  implementation 'com.google.mug:mug-protobuf:9.9.2'\n```\n\u003c/details\u003e\n\n\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fmug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fmug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fmug/lists"}