{"id":19464537,"url":"https://github.com/wolf4ood/gremlin-rs","last_synced_at":"2025-04-08T09:13:47.211Z","repository":{"id":34301445,"uuid":"176026896","full_name":"wolf4ood/gremlin-rs","owner":"wolf4ood","description":"Gremlin Rust","archived":false,"fork":false,"pushed_at":"2024-10-16T11:50:46.000Z","size":1270,"stargazers_count":110,"open_issues_count":23,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-01T07:51:19.023Z","etag":null,"topics":["apache-tinkerpop","graph","hacktoberfest","rust","tinkerpop3"],"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/wolf4ood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2019-03-16T21:30:26.000Z","updated_at":"2025-03-02T16:01:46.000Z","dependencies_parsed_at":"2024-10-18T05:07:00.256Z","dependency_job_id":"e4ca5805-a617-4a32-80ed-f6ee6f8590cc","html_url":"https://github.com/wolf4ood/gremlin-rs","commit_stats":{"total_commits":554,"total_committers":20,"mean_commits":27.7,"dds":0.4548736462093863,"last_synced_commit":"03020421357ec00421fe130ef3b35ea0aa8b1a50"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf4ood%2Fgremlin-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf4ood%2Fgremlin-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf4ood%2Fgremlin-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf4ood%2Fgremlin-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolf4ood","download_url":"https://codeload.github.com/wolf4ood/gremlin-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"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":["apache-tinkerpop","graph","hacktoberfest","rust","tinkerpop3"],"created_at":"2024-11-10T18:15:46.480Z","updated_at":"2025-04-08T09:13:47.178Z","avatar_url":"https://github.com/wolf4ood.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003ch1 align=\"center\"\u003eGremlin-rs\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003e\n    Rust driver and tools for Apache TinkerPop™.\n  \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/wolf4ood/gremlin-rs/actions?query=workflow%3ATests\"\u003e\n    \u003cimg src=\"https://github.com/wolf4ood/gremlin-rs/workflows/Tests/badge.svg\"\n    alt=\"Tests status\" /\u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://coveralls.io/github/wolf4ood/gremlin-rs?branch=master\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/github/wolf4ood/gremlin-rs/badge.svg?branch=master\"\n    alt=\"Coverage status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/gremlin-client\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/gremlin-client.svg?style=flat-square\"\n      alt=\"Download\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://docs.rs/gremlin-client\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\"\n      alt=\"docs.rs docs\" /\u003e\n  \u003c/a\u003e\n\n   \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"\n      alt=\"license\" /\u003e\n  \u003c/a\u003e\n\n   \u003ca href=\"https://deps.rs/repo/github/wolf4ood/gremlin-rs\"\u003e\n    \u003cimg src=\"https://deps.rs/repo/github/wolf4ood/gremlin-rs/status.svg\"\n      alt=\"license\" /\u003e\n  \u003c/a\u003e\n\n\n  \n\u003c/div\u003e\n\n\n\n## gremlin-client\n\nA Rust client for Apache TinkerPop™.\n\n\n\n### Installation\n\n\nInstall from [crates.io](https://crates.io/)\n\n```toml\n[dependencies]\ngremlin-client = \"0.8\"\n```\n\n\nwith [async-std](https://async.rs/) support \n\n```toml\n[dependencies]\ngremlin-client = { version = \"0.8\", features = [\"async-std-runtime\"] }\n```\n\nwith [tokio](https://tokio.rs/) support \n\n```toml\n[dependencies]\ngremlin-client = { version = \"0.4.0\", features = [\"tokio-runtime\"] }\n```\n\n### Examples\n\n\n#### Basic usage\n\n\nExecute a simple Gremlin query with an id and collect the results\n\n**Synchronous**\n\n```rust\nuse gremlin_client::{GremlinClient, Vertex};\n\nfn main() -\u003e Result\u003c(), Box\u003cstd::error::Error\u003e\u003e {\n    let client = GremlinClient::connect(\"localhost\")?;\n\n    let results = client\n        .execute(\"g.V(param)\", \u0026[(\"param\", \u00261)])?\n        .filter_map(Result::ok)\n        .map(|f| f.take::\u003cVertex\u003e())\n        .collect::\u003cResult\u003cVec\u003cVertex\u003e, _\u003e\u003e()?;\n\n    println!(\"{:?}\", results);\n\n    Ok(())\n}\n```\n\n\n**Asynchronous**\n\nWith [async-std](https://async.rs/)\n\nactivate the feature `async-std-runtime`\n\n`gremlin-client = { version = \"*\", features = [\"async-std-runtime\"] }`\n\n```rust\n     \nuse gremlin_client::{aio::GremlinClient, Vertex};\nuse async_std::prelude::*;\n\n#[async_std::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cstd::error::Error\u003e\u003e {\n\n    let client = GremlinClient::connect(\"localhost\").await?;\n    let results = client.execute(\"g.V(param)\", \u0026[(\"param\", \u00261)]).await?\n        .filter_map(Result::ok)\n        .map(|f| f.take::\u003cVertex\u003e())\n        .collect::\u003cResult\u003cVec\u003cVertex\u003e, _\u003e\u003e().await?;\n    println!(\"{:?}\", results);\n    Ok(())\n    \n}\n```\n\nWith [tokio](https://tokio.rs/)\n\nactivate the feature `tokio-runtime`\n\n`gremlin-client = { version = \"*\", features = [\"tokio-runtime\"] }`\n\n```rust\n     \nuse gremlin_client::{aio::GremlinClient, Vertex};\nuse tokio_stream::StreamExt;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cstd::error::Error\u003e\u003e {\n\n    let client = GremlinClient::connect(\"localhost\").await?;\n    let results = client.execute(\"g.V(param)\", \u0026[(\"param\", \u00261)]).await?\n        .filter_map(Result::ok)\n        .map(|f| f.take::\u003cVertex\u003e())\n        .collect::\u003cResult\u003cVec\u003cVertex\u003e, _\u003e\u003e().await?;\n    println!(\"{:?}\", results);\n    Ok(())\n    \n}\n```\n\n#### Traversal example Rust GLV\n\nCreate a remote traversal with the provided `GremlinClient` and build a traversal\nusing Rust language.\n\n**Synchronous**\n\n```rust\n use gremlin_client::{GremlinClient, Vertex, process::traversal::traversal};\n\n fn main() -\u003e Result\u003c(), Box\u003cstd::error::Error\u003e\u003e {\n    let client = GremlinClient::connect(\"localhost\")?;\n\n    let g = traversal().with_remote(client);\n\n    let results = g.v(()).has_label(\"person\").has((\"name\",\"Jon\")).to_list()?;   \n    \n    println!(\"{:?}\", results);\n    Ok(())\n}\n```\n\n\n**Aynchronous**\n\nWith [async-std](https://async.rs/)\n\n```rust\nuse gremlin_client::{aio::GremlinClient, Vertex, process::traversal::traversal};\nuse async_std::prelude::*;\n\n#[async_std::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cstd::error::Error\u003e\u003e {\n\n    \n    let client = GremlinClient::connect(\"localhost\").await?;\n\n    let g = traversal().with_remote_async(client);\n\n    let results = g.v(()).has_label(\"person\").has((\"name\",\"Jon\")).to_list().await?;   \n\n    println!(\"{:?}\", results);\n    Ok(())\n    \n}\n```\n\nWith [tokio](https://tokio.rs/)\n\n```rust\nuse gremlin_client::{aio::GremlinClient, Vertex, process::traversal::traversal};\nuse tokio_stream::StreamExt;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cstd::error::Error\u003e\u003e {\n\n    let client = GremlinClient::connect(\"localhost\").await?;\n\n    let g = traversal().with_remote_async(client);\n\n    let results = g.v(()).has_label(\"person\").has((\"name\",\"Jon\")).to_list().await?;   \n\n    println!(\"{:?}\", results);\n    Ok(())\n}\n```\n\n\n### Additional Features\n\n#### `derive` feature\n\nBy including the `derive` feature in your Cargo.toml\n\n```\n[dependencies]\ngremlin-client = { version = \"*\", features = [\"derive\"] }\n```\n\ntwo derive macros are available \n\n- FromGMap\n- FromGValue\n\nwhich you can use to derive the mapping from GMap and GValue (only Map currently) into structs.\n\n\nwith `GValue`\n\n```rust\nuse gremlin_client::derive::{FromGMap, FromGValue};\nuse gremlin_client::process::traversal::traversal;\nuse gremlin_client::GremlinClient;\nuse std::convert::TryFrom;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let client = GremlinClient::connect(\"localhost\")?;\n\n    #[derive(Debug, PartialEq, FromGValue, FromGMap)]\n    struct Person {\n        name: String,\n    }\n\n    let results = client\n        .execute(\"g.V(param).valueMap()\", \u0026[(\"param\", \u00261)])?\n        .filter_map(Result::ok)\n        .map(|f| Person::try_from(f))\n        .collect::\u003cResult\u003cVec\u003cPerson\u003e, _\u003e\u003e()?;\n\n    println!(\"Person {:?}\", results[0);\n    Ok(())\n}\n\n```\n\nwith `GMap`\n\n```rust\nuse gremlin_client::derive::FromGMap;\nuse gremlin_client::process::traversal::traversal;\nuse gremlin_client::GremlinClient;\nuse std::convert::TryFrom;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let client = GremlinClient::connect(\"localhost\")?;\n\n    #[derive(Debug, PartialEq, FromGMap)]\n    struct Person {\n        name: String,\n    }\n\n    let g = traversal().with_remote(client);\n\n    let results = g\n        .v(1)\n        .value_map(())\n        .iter()?\n        .filter_map(Result::ok)\n        .map(Person::try_from)\n        .collect::\u003cResult\u003cVec\u003cPerson\u003e, _\u003e\u003e()?;\n\n    println!(\"Person {:?}\", results[0);\n\n    Ok(())\n}\n```\n\n\n### Development\n\n\n#### Compiling\n\n```\ngit clone https://github.com/wolf4ood/gremlin-rs.git\ncd gremlin-rs\ncargo build\n```\n\n\n#### Running Tests\n\nSome tests run against a running instance of Gremlin Server with a sample in-memory graph installed.\n\nYou can use docker-compose to start an instance for testing. Use the env variable `GREMLIN_SERVER`\nin order to specify the version of the Gremlin Server\n\n```\ncd docker-compose\nexport GREMLIN_SERVER=3.4.4\ndocker-compose up -d\ncd ..\ncargo test --all-features\n```\n\n\n\n\n## gremlin-cli \n\n\nA minimal cli for exploring graphs data in Gremlin Server.\n\n\n\n### Install\n\n\n```\ncargo install gremlin-cli\n```\n\nor latest release [here](https://github.com/wolf4ood/gremlin-rs/releases)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolf4ood%2Fgremlin-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolf4ood%2Fgremlin-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolf4ood%2Fgremlin-rs/lists"}