{"id":18257826,"url":"https://github.com/janusgraph/janusgraph-python","last_synced_at":"2025-04-04T18:31:22.420Z","repository":{"id":56227479,"uuid":"144779126","full_name":"JanusGraph/janusgraph-python","owner":"JanusGraph","description":"JanusGraph Python Gremlin Language Variant (GLV)","archived":false,"fork":false,"pushed_at":"2025-03-06T11:53:08.000Z","size":163,"stargazers_count":22,"open_issues_count":5,"forks_count":10,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-20T17:05:22.307Z","etag":null,"topics":["glv","gremlin","janusgraph","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JanusGraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-14T22:41:20.000Z","updated_at":"2025-03-13T06:19:42.000Z","dependencies_parsed_at":"2024-06-22T00:33:34.225Z","dependency_job_id":"2040fef2-1fda-4c90-b6b5-653677fd7eb5","html_url":"https://github.com/JanusGraph/janusgraph-python","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JanusGraph","download_url":"https://codeload.github.com/JanusGraph/janusgraph-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247229350,"owners_count":20905033,"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":["glv","gremlin","janusgraph","python"],"created_at":"2024-11-05T10:27:50.731Z","updated_at":"2025-04-04T18:31:22.410Z","avatar_url":"https://github.com/JanusGraph.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JanusGraph-Python\r\n\r\nJanusGraph-Python extends Apache TinkerPop™'s [Gremlin-Python][gremlinpython] with\r\nsupport for [JanusGraph][janusgraph]-specific types.\r\n\r\n## Usage\r\n\r\nTo connect to JanusGraph Server, a `DriverRemoteConnection` instance needs to be\r\ncreated and configured with a message serializer that adds support for\r\nJanusGraph specific types.\r\n\r\nThis can be done like this for GraphSON 3:\r\n\r\n```python\r\nfrom gremlin_python.driver.driver_remote_connection import DriverRemoteConnection\r\nfrom janusgraph_python.driver.serializer import JanusGraphSONSerializersV3d0\r\n\r\nconnection = DriverRemoteConnection(\r\n  'ws://localhost:8182/gremlin', 'g',\r\n  message_serializer=JanusGraphSONSerializersV3d0())\r\n```\r\n\r\nThis can be done like this for GraphBinary:\r\n\r\n```python\r\nfrom gremlin_python.driver.driver_remote_connection import DriverRemoteConnection\r\nfrom janusgraph_python.driver.serializer import JanusGraphBinarySerializersV1\r\n\r\nconnection = DriverRemoteConnection(\r\n 'ws://localhost:8182/gremlin', 'g',\r\n message_serializer=JanusGraphBinarySerializersV1())\r\n```\r\n\r\nNote that the client should be disposed on shut down to release resources and\r\nto close open connections with `connection.close()`.\r\nThe connection can then be used to configure a `GraphTraversalSource`:\r\n\r\n```python\r\nfrom gremlin_python.process.anonymous_traversal import traversal\r\n\r\ng = traversal().with_remote(connection)\r\n# Reuse 'g' across the application\r\n```\r\n\r\nThe `GraphTraversalSource` `g` can now be used to spawn Gremlin traversals:\r\n\r\n```python\r\nhercules_age = g.V().has(\"demigod\", \"name\", \"hercules\").values(\"age\").next()\r\nprint(f\"Hercules is {hercules_age} years old.\")\r\n```\r\n\r\nRefer to the chapter [Gremlin Query Language][gremlin-chapter] in the\r\nJanusGraph docs for an introduction to Gremlin and pointers to further\r\nresources.\r\nThe main syntactical difference for Gremlin-Python is that it follows Python naming\r\nconventions, e.g., method names use snake_case instead of camelCase. Other difference is that when Python reserved words (e.g. \"is\") overlap with Gremlin steps or tokens, those gets underscore suffix (e.g. \"is_\").\r\n\r\n### Text Predicates\r\n\r\nThe `Text` class provides methods for\r\n[full-text and string searches][text-predicates]:\r\n\r\n```python\r\nfrom janusgraph_python.process.traversal import Text\r\n\r\ng.V().has(\"demigod\", \"name\", Text.text_prefix(\"herc\")).to_list()\r\n```\r\n\r\nThe other text predicates can be used the same way.\r\n\r\n## Version Compatibility\r\n\r\nThe lowest supported JanusGraph version is 1.0.0.\r\nThe following table shows the supported JanusGraph versions for each version\r\nof JanusGraph-Python:\r\n\r\n| JanusGraph-Python | JanusGraph             |\r\n| ----------------- | ---------------------- |\r\n| 1.0.z             | 1.0.z                  |\r\n| 1.1.z             | (1.0.z,) 1.1.z         |\r\n\r\nWhile it should also be possible to use JanusGraph-Python with other versions of\r\nJanusGraph than mentioned here, compatibility is not tested and some\r\nfunctionality (like added Gremlin steps) will not work as it is not supported\r\nyet in case of an older JanusGraph version or was removed in a newer JanusGraph\r\nversion.\r\n\r\n## Serialization Formats\r\n\r\nJanusGraph-Python supports GraphSON 3 as well as GraphBinary.\r\n\r\nNot all of the JanusGraph-specific types are already supported by the formats:\r\n\r\n| Format      | RelationIdentifier | Text predicates | Geoshapes | Geo predicates |\r\n| ----------- | ------------------ | --------------- | --------- | -------------- |\r\n| GraphSON3   | x                  | x               | -         | -              |\r\n| GraphBinary | x                  | x               | -         | -              |\r\n\r\n## Community\r\n\r\nJanusGraph-Python uses the same communication channels as JanusGraph in general.\r\nSo, please refer to the\r\n[_Community_ section in JanusGraph's main repository][janusgraph-community]\r\nfor more information about these various channels.\r\n\r\nPlease use GitHub issues only to report bugs or request features.\r\n\r\n## Contributing\r\n\r\nPlease see\r\n[`CONTRIBUTING.md` in JanusGraph's main repository][janusgraph-contributing]\r\nfor more information, including CLAs and best practices for working with\r\nGitHub.\r\n\r\n## License\r\n\r\nJanusGraph-Python code is provided under the [Apache 2.0 license](APACHE-2.0.txt)\r\nand documentation is provided under the [CC-BY-4.0 license](CC-BY-4.0.txt). For\r\ndetails about this dual-license structure, please see\r\n[`LICENSE.txt`](LICENSE.txt).\r\n\r\n[janusgraph]: https://janusgraph.org/\r\n[gremlinpython]: https://tinkerpop.apache.org/docs/current/reference/#gremlin-python\r\n[gremlin-chapter]: https://docs.janusgraph.org/getting-started/gremlin/\r\n[text-predicates]: https://docs.janusgraph.org/interactions/search-predicates/#text-predicate\r\n[janusgraph-community]: https://github.com/JanusGraph/janusgraph#community\r\n[janusgraph-contributing]: https://github.com/JanusGraph/janusgraph/blob/master/CONTRIBUTING.md","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanusgraph%2Fjanusgraph-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanusgraph%2Fjanusgraph-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanusgraph%2Fjanusgraph-python/lists"}