{"id":13493254,"url":"https://github.com/mitsuhiko/similar","last_synced_at":"2025-04-23T21:02:36.986Z","repository":{"id":43421461,"uuid":"330488939","full_name":"mitsuhiko/similar","owner":"mitsuhiko","description":"A high level diffing library for rust based on diffs","archived":false,"fork":false,"pushed_at":"2025-02-05T22:12:45.000Z","size":483,"stargazers_count":1075,"open_issues_count":15,"forks_count":37,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-23T21:02:12.401Z","etag":null,"topics":["diff","patch","rust","unified-diff"],"latest_commit_sha":null,"homepage":"https://insta.rs/similar","language":"Rust","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/mitsuhiko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":["mitsuhiko"]}},"created_at":"2021-01-17T21:19:30.000Z","updated_at":"2025-04-22T10:34:17.000Z","dependencies_parsed_at":"2024-06-18T15:16:58.002Z","dependency_job_id":"eb47d9a0-4bbb-445d-b73d-af7b1d7c913a","html_url":"https://github.com/mitsuhiko/similar","commit_stats":{"total_commits":184,"total_committers":11,"mean_commits":"16.727272727272727","dds":0.05434782608695654,"last_synced_commit":"7e15c44de11a1cd61e1149189929e189ef977fd8"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fsimilar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fsimilar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fsimilar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fsimilar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitsuhiko","download_url":"https://codeload.github.com/mitsuhiko/similar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514772,"owners_count":21443209,"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":["diff","patch","rust","unified-diff"],"created_at":"2024-07-31T19:01:13.584Z","updated_at":"2025-04-23T21:02:36.959Z","avatar_url":"https://github.com/mitsuhiko.png","language":"Rust","funding_links":["https://github.com/sponsors/mitsuhiko"],"categories":["Rust","rust"],"sub_categories":[],"readme":"# Similar: A Diffing Library\n\n[![Crates.io](https://img.shields.io/crates/d/similar.svg)](https://crates.io/crates/similar)\n[![License](https://img.shields.io/github/license/mitsuhiko/similar)](https://github.com/mitsuhiko/similar/blob/main/LICENSE)\n[![rustc 1.60.0](https://img.shields.io/badge/rust-1.60%2B-orange.svg)](https://img.shields.io/badge/rust-1.60%2B-orange.svg)\n[![Documentation](https://docs.rs/similar/badge.svg)](https://docs.rs/similar)\n\nSimilar is a dependency free crate for Rust that implements different diffing\nalgorithms and high level interfaces for it. It is based on the\n[pijul](https://pijul.org/) implementation of the Patience algorithm and\ninherits some ideas from there. It also incorporates the Myers' diff\nalgorithm which was largely written by Brandon Williams.  This library was\nbuilt for the [insta snapshot testing library](https://insta.rs).\n\n```rust\nuse similar::{ChangeTag, TextDiff};\n\nfn main() {\n    let diff = TextDiff::from_lines(\n        \"Hello World\\nThis is the second line.\\nThis is the third.\",\n        \"Hallo Welt\\nThis is the second line.\\nThis is life.\\nMoar and more\",\n    );\n\n    for change in diff.iter_all_changes() {\n        let sign = match change.tag() {\n            ChangeTag::Delete =\u003e \"-\",\n            ChangeTag::Insert =\u003e \"+\",\n            ChangeTag::Equal =\u003e \" \",\n        };\n        print!(\"{}{}\", sign, change);\n    }\n}\n```\n\n## Screenshot\n\n![terminal highlighting](https://raw.githubusercontent.com/mitsuhiko/similar/main/assets/terminal-inline.png)\n\n## What's in the box?\n\n* Myers' diff\n* Patience diff\n* Hunt–McIlroy / Hunt–Szymanski LCS diff\n* Diffing on arbitrary comparable sequences\n* Line, word, character and grapheme level diffing\n* Text and Byte diffing\n* Unified diff generation\n\n## Related Projects\n\n* [insta](https://insta.rs) snapshot testing library\n* [similar-asserts](https://github.com/mitsuhiko/similar-asserts) assertion library\n\n## License and Links\n\n* [Documentation](https://docs.rs/similar/)\n* [Issue Tracker](https://github.com/mitsuhiko/similar/issues)\n* [Examples](https://github.com/mitsuhiko/similar/tree/main/examples)\n* License: [Apache-2.0](https://github.com/mitsuhiko/similar/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsuhiko%2Fsimilar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitsuhiko%2Fsimilar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsuhiko%2Fsimilar/lists"}