{"id":15097578,"url":"https://github.com/woodruffw/yamlpath","last_synced_at":"2025-04-15T00:28:36.008Z","repository":{"id":256078473,"uuid":"854210267","full_name":"woodruffw/yamlpath","owner":"woodruffw","description":"A library and CLI tool for format-preserving YAML queries","archived":false,"fork":false,"pushed_at":"2025-04-14T15:57:27.000Z","size":111,"stargazers_count":11,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T16:51:32.472Z","etag":null,"topics":["tree-sitter","yaml"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/yamlpath","language":"Rust","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/woodruffw.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},"funding":{"github":"woodruffw","thanks_dev":"u/gh/woodruffw"}},"created_at":"2024-09-08T17:04:19.000Z","updated_at":"2025-04-14T15:57:27.000Z","dependencies_parsed_at":"2024-12-10T20:27:20.101Z","dependency_job_id":"908afb82-fa22-4ef9-8414-7094dd782c8d","html_url":"https://github.com/woodruffw/yamlpath","commit_stats":{"total_commits":47,"total_committers":1,"mean_commits":47.0,"dds":0.0,"last_synced_commit":"8dcfae2f795577390248532e7f21804353eb3f0a"},"previous_names":["woodruffw/yamlpath"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fyamlpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fyamlpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fyamlpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fyamlpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woodruffw","download_url":"https://codeload.github.com/woodruffw/yamlpath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248983213,"owners_count":21193536,"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":["tree-sitter","yaml"],"created_at":"2024-09-25T16:23:44.228Z","updated_at":"2025-04-15T00:28:35.990Z","avatar_url":"https://github.com/woodruffw.png","language":"Rust","funding_links":["https://github.com/sponsors/woodruffw","https://thanks.dev/u/gh/woodruffw"],"categories":[],"sub_categories":[],"readme":"# yamlpath\n\n\n[![CI](https://github.com/woodruffw/yamlpath/actions/workflows/ci.yml/badge.svg)](https://github.com/woodruffw/yamlpath/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/yamlpath)](https://crates.io/crates/yamlpath)\n[![docs.rs](https://img.shields.io/docsrs/yamlpath)](https://docs.rs/yamlpath)\n\nFormat-preserving YAML feature extraction.\n\nYou can use this library (or [`yp`](#the-yp-cli), its associated CLI) to perform\nbasic queries over YAML documents, returning exact line- and byte-span\nresults with comments and formatting preserved exactly as they appear\nin the original source.\n\n`yamlpath` uses [`tree-sitter`] and [`tree-sitter-yaml`] under the hood.\n\n[`tree-sitter`]: https://github.com/tree-sitter/tree-sitter\n\n[`tree-sitter-yaml`]: https://github.com/tree-sitter-grammars/tree-sitter-yaml\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e This is not a substitute for full-fledged query languages or tools\n\u003e like JSONPath or `jq`.\n\n## Why?\n\nYAML is an extremely popular configuration format, with an interior\ndata model that closely resembles JSON.\n\nIt's common to need to analyze YAML files, e.g. for a security tool that\nneeds to interpret the contents of a configuration file.\n\nThe normal way to do this is to parse the YAML into a document and interpret\nthat document. However, that parsing operation is *destructive*: in producing\na document model, it *erases* the comments and exact formatting of the YAML\ninput.\n\nThis can make it difficult to present intelligible actions to uses,\nsince users think in terms of changes needed on lines and columns and not\nchanges needed to a specific sub-object within a document's hierarchy.\n\n`yamlpath` bridges the gap between these two views: it allows a program\nto operate on the (optimal) document view, and then *translate* back to\na human's understanding of the YAML input.\n\n## The `yp` CLI\n\n`yamlpath` is developed primarily as a library, but the `yp` CLI exists\nto demonstrate what it can do.\n\nTo get started with it, you can either build it from ths repository:\n\n```bash\ncargo build -p yp\n```\n\n...and then use it:\n\n```bash\nyp --help\nyp 'foo.bar.[1].baz' some-input.yml\n```\n\nNote: the format of `yp`'s output is not stable or intended for programmatic\nconsumption. Similarly, the query language used by `yp` is not stable or\nintended for non-experimental use.\n\n## License\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodruffw%2Fyamlpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoodruffw%2Fyamlpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodruffw%2Fyamlpath/lists"}