{"id":16752631,"url":"https://github.com/jonasbb/petgraph-graphml","last_synced_at":"2025-04-13T08:23:19.066Z","repository":{"id":32426732,"uuid":"133268081","full_name":"jonasbb/petgraph-graphml","owner":"jonasbb","description":"GraphML output generator for petgraph","archived":false,"fork":false,"pushed_at":"2025-01-11T23:46:53.000Z","size":121,"stargazers_count":17,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T05:04:28.530Z","etag":null,"topics":["graphml","petgraph","rust"],"latest_commit_sha":null,"homepage":"","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/jonasbb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"jonasbb","thanks_dev":"u/gh/jonasbb"}},"created_at":"2018-05-13T19:32:35.000Z","updated_at":"2025-01-11T23:46:49.000Z","dependencies_parsed_at":"2024-07-07T20:47:37.813Z","dependency_job_id":"e2fc8ce4-b401-4b12-b36a-8a134bbe662b","html_url":"https://github.com/jonasbb/petgraph-graphml","commit_stats":{"total_commits":56,"total_committers":4,"mean_commits":14.0,"dds":0.375,"last_synced_commit":"63f18e0ec637a435a9999a48a395113aa835e12b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbb%2Fpetgraph-graphml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbb%2Fpetgraph-graphml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbb%2Fpetgraph-graphml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbb%2Fpetgraph-graphml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasbb","download_url":"https://codeload.github.com/jonasbb/petgraph-graphml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681836,"owners_count":21144758,"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":["graphml","petgraph","rust"],"created_at":"2024-10-13T02:47:41.305Z","updated_at":"2025-04-13T08:23:19.039Z","avatar_url":"https://github.com/jonasbb.png","language":"Rust","readme":"# [GraphML][graphmlwebsite] output support for [petgraph]\n\n[![docs.rs badge](https://docs.rs/petgraph-graphml/badge.svg)](https://docs.rs/petgraph-graphml/)\n[![crates.io badge](https://img.shields.io/crates/v/petgraph-graphml.svg)](https://crates.io/crates/petgraph-graphml/)\n[![Rust CI](https://github.com/jonasbb/petgraph-graphml/workflows/Rust%20CI/badge.svg)](https://github.com/jonasbb/petgraph-graphml)\n[![codecov](https://codecov.io/gh/jonasbb/petgraph-graphml/branch/master/graph/badge.svg)](https://codecov.io/gh/jonasbb/petgraph-graphml)\n\n---\n\nThis crate extends [petgraph][] with [GraphML][graphmlwebsite] output support.\n\nThis crate exports a single type [`GraphMl`] which combines a build-pattern for configuration and provides creating strings ([`GraphMl::to_string`]) and writing to writers ([`GraphMl::to_writer`]).\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\npetgraph-graphml = \"4.0.0\"\n```\n\n## Example\n\nFor a simple graph like ![Graph with three nodes and two edges](https://github.com/jonasbb/petgraph-graphml/tree/master/doc/graph.png) this is the generated GraphML output.\n\n```rust\nlet graph = make_graph();\n// Configure output settings\n// Enable pretty printing and exporting of node weights.\n// Use the Display implementation of NodeWeights for exporting them.\nlet graphml = GraphMl::new(\u0026graph)\n    .pretty_print(true)\n    .export_node_weights_display();\n\nassert_eq!(\n    graphml.to_string(),\n    r#\"\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cgraphml xmlns=\"http://graphml.graphdrawing.org/xmlns\"\u003e\n  \u003cgraph edgedefault=\"directed\"\u003e\n    \u003cnode id=\"n0\"\u003e\n      \u003cdata key=\"weight\"\u003e0\u003c/data\u003e\n    \u003c/node\u003e\n    \u003cnode id=\"n1\"\u003e\n      \u003cdata key=\"weight\"\u003e1\u003c/data\u003e\n    \u003c/node\u003e\n    \u003cnode id=\"n2\"\u003e\n      \u003cdata key=\"weight\"\u003e2\u003c/data\u003e\n    \u003c/node\u003e\n    \u003cedge id=\"e0\" source=\"n0\" target=\"n1\" /\u003e\n    \u003cedge id=\"e1\" source=\"n1\" target=\"n2\" /\u003e\n  \u003c/graph\u003e\n  \u003ckey id=\"weight\" for=\"node\" attr.name=\"weight\" attr.type=\"string\" /\u003e\n\u003c/graphml\u003e\"#\n);\n```\n\n[`GraphMl`]: https://docs.rs/petgraph-graphml/*/petgraph_graphml/struct.GraphMl.html\n[`GraphMl::to_string`]: https://docs.rs/petgraph-graphml/*/petgraph_graphml/struct.GraphMl.html#method.to_string\n[`GraphMl::to_writer`]: https://docs.rs/petgraph-graphml/*/petgraph_graphml/struct.GraphMl.html#method.to_writer\n[graphmlwebsite]: http://graphml.graphdrawing.org/\n[petgraph]: https://docs.rs/petgraph/\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","funding_links":["https://github.com/sponsors/jonasbb","https://thanks.dev/u/gh/jonasbb"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbb%2Fpetgraph-graphml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasbb%2Fpetgraph-graphml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbb%2Fpetgraph-graphml/lists"}