{"id":16352234,"url":"https://github.com/bugthesystem/pyley","last_synced_at":"2025-03-16T15:31:55.563Z","repository":{"id":18441478,"uuid":"21630462","full_name":"bugthesystem/pyley","owner":"bugthesystem","description":"Python package for an open-source graph database Cayley","archived":false,"fork":false,"pushed_at":"2019-10-26T20:34:25.000Z","size":97,"stargazers_count":159,"open_issues_count":3,"forks_count":30,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-12T01:25:25.435Z","etag":null,"topics":["cayley","graph-database","python"],"latest_commit_sha":null,"homepage":"https://cayley.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugthesystem.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-08T21:45:49.000Z","updated_at":"2024-09-08T02:55:00.000Z","dependencies_parsed_at":"2022-07-19T18:09:16.199Z","dependency_job_id":null,"html_url":"https://github.com/bugthesystem/pyley","commit_stats":null,"previous_names":["bugthesystem/pyley","ziyasal/pyley"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2Fpyley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2Fpyley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2Fpyley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2Fpyley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugthesystem","download_url":"https://codeload.github.com/bugthesystem/pyley/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221665477,"owners_count":16860259,"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":["cayley","graph-database","python"],"created_at":"2024-10-11T01:25:26.405Z","updated_at":"2024-10-27T10:50:44.783Z","avatar_url":"https://github.com/bugthesystem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://github.com/ziyasal/pyley/raw/master/pyley.png?raw=true\n\npyley\n=====\n\n.. image:: https://img.shields.io/pypi/v/pyley.svg\n    :target: https://pypi.org/project/pyley\n\n.. image:: https://img.shields.io/pypi/pyversions/pyley.svg\n    :target: https://pypi.org/project/pyley\n\n.. image:: https://travis-ci.org/ziyasal/pyley.svg?branch=master\n    :target: https://travis-ci.org/ziyasal/pyley\n\n.. image:: https://coveralls.io/repos/ziyasal/pyley/badge.svg?branch=master\u0026service=github\n    :target: https://coveralls.io/github/ziyasal/pyley?branch=master\n\n`Python \u003chttps://www.python.org/\u003e`_ client for an open-source graph database **Cayley** `\u003chttps://github.com/google/cayley\u003e`_.\n\n    Cayley is an open-source graph inspired by the graph database behind `Freebase \u003chttp://freebase.com/\u003e`_ and Google's `Knowledge Graph \u003chttp://www.google.com/insidesearch/features/search/knowledge.html\u003e`_. Its goal is to be a part of the developer's toolbox where `Linked Data \u003chttp://linkeddata.org/\u003e`_ and graph-shaped data (semantic webs, social networks, etc) in general are concerned.\n\nInstall via pip\n---------------\n\nYou can install pyley using::\n\n    $ pip install pyley\n\nSample\n------\n\n**Import pyley:**\n\n.. code-block:: python\n\n    from pyley import CayleyClient, GraphObject\n\n    # Create cayley client\n    # this creates client with default parameters `http://localhost:64210/api/v1/query/gizmo`\n    client = CayleyClient()\n    \n    # or  specify `url` and `version` parameters\n    client = CayleyClient(\"http://localhost:64210\", \"v1\")\n  \n    g = GraphObject()\n\n    # Query all vertices in the graph, limit to the first 5 vertices found.\n    g.Vertex().GetLimit(5)\n  \n    # Start with only one vertex, the literal name \"Humphrey Bogart\", and retrieve all of them.\n    query = g.Vertex(\"Humphrey Bogart\").All();\n    response = client.Send(query)\n    # response.result contains JSON data and response.r contains raw response\n    print response.result \n    \n    # `g` and `V` are synonyms for `graph` and `Vertex` respectively, as they are quite common.\n    query = g.V(\"Humphrey Bogart\").All()\n    response = client.Send(query)\n    \n    # \"Humphrey Bogart\" is a name, but not an entity. \n    # Let's find the entities with this name in our dataset.\n    # Follow links that are pointing In to our \"Humphrey Bogart\" node with the predicate \"name\".\n    query = g.V(\"Humphrey Bogart\").In(\"\u003cname\u003e\").All()\n    response = client.Send(query)\n  \n    # Notice that \"name\" is a generic predicate in our dataset. \n    # Starting with a movie gives a similar effect.\n    query = g.V(\"Casablanca\").In(\"name\").All()\n    response = client.Send(query)\n\n    # Relatedly, we can ask the reverse; all ids with the name \"Casablanca\"\n    query = g.V().Has(\"name\", \"Casablanca\").All()\n    response = client.Send(query)\n    \n    # Let's get the list of actors in the film\n    query = g.V().Has(\"name\", \"Casablanca\") \\\n                  .Out(\"/film/film/starring\") \\\n                  .Out(\"/film/performance/actor\") \\\n                  .Out(\"name\") \\\n                  .All()\n\n    response = client.Send(query)\n  \n    # But this is starting to get long. \n    # Let's use a morphism -- a pre-defined path stored in a variable -- as our linkage\n    film_to_actor = g.Morphism().Out(\"/film/film/starring\").Out(\"/film/performance/actor\")\n    query = g.V() \\\n            .Has(\"name\", \"Casablanca\") \\\n            .Follow(film_to_actor) \\\n            .Out(\"name\") \\\n            .All()\n    response = client.Send(query)\n\n    # Add data programatically to the JSON result list. Can be any JSON type.\n    query = g.Emit({'name': \"John Doe\", 'age': 41, 'isActor': True})\n    response = client.Send(query)\n\nBugs\n----\n\nIf you encounter a bug, performance issue, or malfunction, please add an `Issues \u003chttps://github.com/ziyasal/pyley/issues\u003e`_ with steps on how to reproduce the problem\nor feel to free to open a pull request.\n\n\nTODO\n----\n\n- Improve Gizmo implementation (Basic steps implemented at the moment)\n- Add more tests\n- Add more documentation\n\nOpen Source  Projects in Use\n----------------------------\n\n- `requests \u003chttps://github.com/kennethreitz/requests\u003e`_ by @kennethreitz\n\nLicense\n-------\n\n@ziλasal \u0026 @abdullahselek\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugthesystem%2Fpyley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugthesystem%2Fpyley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugthesystem%2Fpyley/lists"}