Choosing an appropriate way to use Neo4j in Python

房东的猫 提交于 2019-11-30 12:12:55

Django is an MVC web framework so you may be interested in that if yours is to be a web application.

From the point of view of py2neo (of which I am the author), I am trying to focus hard on performance by using the batch execution mechanism automatically where appropriate as well as providing strong Cypher support. I have also recently put a lot of work into providing good options for uniqueness management within indexes - specifically, the get_or_create and add_if_none methods.

The easiest way to run algorithms from Python is to use Gremlin (https://github.com/tinkerpop/gremlin/wiki).

With Gremlin you can bundle everything into one HTTP request to reduce round-trip overhead.

Here's how to execute Gremlin scripts from Bulbs (http://bulbflow.com):

>>> from bulbs.neo4jserver import Graph
>>> g = Graph()
>>> script = "g.v(id).out('knows').out('knows')"
>>> params = dict(id=3)
>>> g.gremlin.execute(script, params)

The Bulbs Gremlin API docs are here: http://bulbflow.com/docs/api/bulbs/gremlin/

Not really sure, I am not an expert, but I think it also depends on your Django expectations, and how much of a framework you need. Py2neo is very pragmatic and slim, Bulbflow seems to build up a whole mapping stack etc, and neo4jrestclient is concentrating on Django (that may be wrong)?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!