pawamoy / neopy

Neo4j for Python. Manipulate graph data in Python with Neo4j as data storage.
ISC License
7 stars 0 forks source link

Check out Pypher for query building #4

Open emehrkay opened 6 years ago

emehrkay commented 6 years ago

I wrote Pypher last month and its purpose is to write Python and produce Cypher. Your project could potentially benefit from it. Let me know if you use it or have any questions

https://github.com/emehrkay/Pypher

pawamoy commented 6 years ago

Ooooh very nice! Sometimes it bothers me to realize I simply missed out already existing apps. I'm gonna give it a try, thanks :smile: !

pawamoy commented 6 years ago

So here is some feedback @emehrkay !

First of all, Pypher looks great. Features and code. :+1:

My thoughts about using for my project now. I think I have two options:

  1. use Pypher directly. It seems to support Cypher entirely. It would just be a matter of wrapping queries into objects that add the ability to execute the queries, fetch and inflate/hydrate objects and do some caching for optimization purpose.
  2. wrap Pypher queries into a different API. Basically I would embed Pypher builder into higher-level graph manipulation methods. But I fear that it would sometimes be redundant, if not completely mixed up, and I want to avoid such unclean code.

So I would rather choose option 1. But a few things are pushing me away:

So for now I don't think I'm gonna use Pypher for my project. But I might change my mind later ;)

Please note that I am not saying there's something wrong with your code, it's just me trying to evaluate the pros/cons to use Pypher for my particular use case ^^. I'm not asking you to change your code in any way!

Feel free to drop your thoughts here as well :thought_balloon: !

Oh, and Pypher is such a better name than neopy :hear_no_evil: Too bad someone already registered it on PyPI!

emehrkay commented 6 years ago

Wow. Thank you for the evaluations and audit. It will only make Pypher a better project.

To answer some of your points:

I mainly use Pypher in an abstracted api. I too am building a Neo4j OGM (https://twitter.com/emehrkay/status/983004798558580737?s=21) and I have a Query object that takes Node or Relationship objects and transforms them into Cypher via Pypher (I’ll show it to you once I am done with the mapper, should be soon). The Pypher portion could be replaced, but it would probably be messy.

Again thank you for the feedback/code review. It is very helpful.