{"id":23819789,"url":"https://github.com/rkosegi/yaml-toolkit","last_synced_at":"2026-01-16T22:55:56.336Z","repository":{"id":143239518,"uuid":"615169816","full_name":"rkosegi/yaml-toolkit","owner":"rkosegi","description":"Tools to manipulate data within the YAML files and more","archived":false,"fork":false,"pushed_at":"2026-01-13T14:15:57.000Z","size":670,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T16:56:41.149Z","etag":null,"topics":["jmespath","jsonpath","k8s","rfc6901","rfc6902","rfc9535","yaml"],"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/rkosegi.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-17T05:15:41.000Z","updated_at":"2026-01-13T14:15:59.000Z","dependencies_parsed_at":"2023-08-28T21:17:03.075Z","dependency_job_id":"4a89f4e8-3b1f-4b8b-bb0d-aade28975e1b","html_url":"https://github.com/rkosegi/yaml-toolkit","commit_stats":null,"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/rkosegi/yaml-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkosegi%2Fyaml-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkosegi%2Fyaml-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkosegi%2Fyaml-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkosegi%2Fyaml-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkosegi","download_url":"https://codeload.github.com/rkosegi/yaml-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkosegi%2Fyaml-toolkit/sbom","scorecard":{"id":480491,"data":{"date":"2025-08-19T14:15:18Z","repo":{"name":"github.com/rkosegi/yaml-toolkit","commit":"0b1e06ebbec50dd7c5d463b5168aa965b564acdb"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":6.4,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 1 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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'packages' permission set to 'read': .github/workflows/codeql.yaml:34","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yaml:35","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yaml:36","Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yaml:31","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yaml:26","Info: topLevel 'contents' permission set to 'read': .github/workflows/labeler.yaml:21","Info: topLevel permissions set to 'read-all': .github/workflows/ossf.yaml:22","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yaml:22","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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":8,"reason":"dependency not pinned by hash detected -- score normalized to 8","details":["Warn: goCommand not pinned by hash: .github/workflows/ci.yaml:44","Info:  12 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   4 out of   4 third-party GitHubAction dependencies pinned","Info:   0 out of   1 goCommand 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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (28) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Info: 'stale review dismissal' is required to merge on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Warn: codeowners review is not required on branch 'main'","Warn: 'last push approval' is disabled on branch 'main'","Info: 'up-to-date branches' is required to merge on branch 'main'","Info: status check found to merge onto on branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"Contributors","score":3,"reason":"project has 1 contributing companies or organizations -- score normalized to 3","details":["Info: found contributions from: dNationCloud"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"CI-Tests","score":10,"reason":"28 out of 28 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-08-19T16:28:52.007Z","repository_id":143239518,"created_at":"2025-08-19T16:28:52.007Z","updated_at":"2025-08-19T16:28:52.007Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28486938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["jmespath","jsonpath","k8s","rfc6901","rfc6902","rfc9535","yaml"],"created_at":"2025-01-02T07:15:18.698Z","updated_at":"2026-01-16T22:55:56.320Z","avatar_url":"https://github.com/rkosegi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YAML toolkit\n\n[![codecov](https://codecov.io/gh/rkosegi/yaml-toolkit/graph/badge.svg?token=BX0P2QQPR2)](https://codecov.io/gh/rkosegi/yaml-toolkit)\n[![Go Report Card](https://goreportcard.com/badge/github.com/rkosegi/yaml-toolkit)](https://goreportcard.com/report/github.com/rkosegi/yaml-toolkit)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rkosegi_yaml-toolkit\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rkosegi_yaml-toolkit)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=rkosegi_yaml-toolkit\u0026metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=rkosegi_yaml-toolkit)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=rkosegi_yaml-toolkit\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=rkosegi_yaml-toolkit)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=rkosegi_yaml-toolkit\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=rkosegi_yaml-toolkit)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=rkosegi_yaml-toolkit\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=rkosegi_yaml-toolkit)\n[![Go Reference](https://pkg.go.dev/badge/github.com/rkosegi/yaml-toolkit.svg)](https://pkg.go.dev/github.com/rkosegi/yaml-toolkit)\n[![Apache 2.0 License](https://badgen.net/static/license/Apache2.0/blue)](https://github.com/rkosegi/yaml-toolkit/blob/main/LICENSE)\n[![CodeQL Status](https://github.com/rkosegi/yaml-toolkit/actions/workflows/codeql.yaml/badge.svg)](https://github.com/rkosegi/yaml-toolkit/security/code-scanning)\n[![CI Status](https://github.com/rkosegi/yaml-toolkit/actions/workflows/ci.yaml/badge.svg)](https://github.com/rkosegi/yaml-toolkit/actions/workflows/ci.yaml)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/rkosegi/yaml-toolkit/badge)](https://scorecard.dev/viewer/?uri=github.com/rkosegi/yaml-toolkit)\n\nGo library to deal with (not only) YAML documents.\n\n\n## Usage\n\n### Loading configuration file with defaults\n\ngiven configuration file\n\n`config.yaml`\n```yaml\n---\nlisten_address: 0.0.0.0:8080\nread_timeout: 15s\n```\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\n\t\"github.com/rkosegi/yaml-toolkit/dom\"\n\t\"github.com/rkosegi/yaml-toolkit/fluent\"\n)\n\ntype Config struct {\n\tAddress     string        `yaml:\"listen_address\"`\n\tReadTimeout time.Duration `yaml:\"read_timeout\"`\n}\n\nvar defConfig = \u0026Config{\n\tAddress: \"0.0.0.0:8081\",\n}\n\nfunc main() {\n\tcfg := fluent.NewConfigHelper[Config]().\n\t\tAdd(defConfig).         // add defaults\n\t\tLoad(\"config.yaml\").    // override with values loaded from YAML document\n\t\tResult()                // get merged results\n\n\t// ... use cfg\n}\n```\n\n### Opening embedded YAML\n\n`example.yaml`\n```yaml\n---\nkind: ConfigMap\nmetadata:\n  name: cm1\n  namespace: default\napiVersion: v1\ndata:\n  application.yaml: |\n    xyz: 456\n    abc:\n      def:\n        leaf1: 123\n        leaf2: Hello\n```\n\ncode\n```go\npackage main\n\nimport (\n    ydom \"github.com/rkosegi/yaml-toolkit/dom\"\n    yk8s \"github.com/rkosegi/yaml-toolkit/k8s\"\n)\n\nfunc main() {\n\td, err := yk8s.YamlDoc(\"example.yaml\", \"application.yaml\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tprint (d.Document().Child(\"xyz\").(ydom.Leaf).Value()) // 456\n\td.Document().AddValue(\"another-key\", ydom.LeafNode(\"789\")) // add new child node\n\terr = d.Save()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n### Compute difference between 2 documents\n\n\u003ctable\u003e\n\u003cthead\u003e\u003ctr\u003e\u003cth\u003eLeft\u003c/th\u003e\u003cth\u003eRight\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eleft.yaml\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003eright.yaml\u003c/code\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\n\n```yaml\n---\nroot:\n  sub1:\n    leaf1: abc\n    leaf2: 123\n  list:\n    - 1\n    - 2\n```\n\u003c/td\u003e\u003ctd\u003e\n\n```yaml\n---\nroot:\n  sub1:\n    leaf1: def\n    leaf3: 789\n  list:\n    - 3\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tyta \"github.com/rkosegi/yaml-toolkit/analytics\"\n\tytc \"github.com/rkosegi/yaml-toolkit/common\"\n\tydiff \"github.com/rkosegi/yaml-toolkit/diff\"\n)\n\nfunc main() {\n\tdp := ytc.DefaultFileDecoderProvider(\".yaml\")\n\tds := yta.NewDocumentSet()\n\terr := ds.AddDocumentFromFile(\"left.yaml\", dp, yta.WithTags(\"left\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = ds.AddDocumentFromFile(\"right.yaml\", dp, yta.WithTags(\"right\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tchanges := ydiff.Diff(\n\t\tds.TaggedSubset(\"right\").Merged(),\n\t\tds.TaggedSubset(\"left\").Merged(),\n\t)\n\tfmt.Printf(\"All changes: %d\\n\", len(*changes))\n\tfor _, change := range *changes {\n\t\tfmt.Printf(\"%s: %s =\u003e %v\\n\", change.Type, change.Path, change.Value)\n\t}\n}\n```\n\noutput:\n```\nAll changes: 5\nDelete: root.list =\u003e \u003cnil\u003e\nAdd: root.list[0] =\u003e 3\nChange: root.sub1.leaf1 =\u003e abc\nDelete: root.sub1.leaf2 =\u003e \u003cnil\u003e\nAdd: root.sub1.leaf3 =\u003e 789\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkosegi%2Fyaml-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkosegi%2Fyaml-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkosegi%2Fyaml-toolkit/lists"}