Open emehrkay opened 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: !
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:
So I would rather choose option 1. But a few things are pushing me away:
__.node
, so we cannot reference a node with the node
variable, because afterward we would not be able to use __.node.__prop__
. Or am I wrong? I guess other keywords are reserved in other places/ways but I did not check. Since Neo4j do not reserve any keyword for variable names (not sure for this one), labels, types or property names, I would prefer the library to do the same. But maybe I am wrong again! ^^SET(__.var.__prop__ == value)
to be a bit confusing (==
instead of =
when you read it out loud).WHERE(..., ...)
and WHERE.var.__prop__
(even if I think it's a good feature at the same time).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!
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.
All of the predefined statements, functions, and everything that subclasses the Pypher class are “reserved” and would result in unexpected behavior when used that way. What you “want” to do, in Pypher speak, is add a Statement with the value of “node” that isn’t as straight forward (you’d need to call add_link directly etc), but I do know how to address it.
yeah I thought that was weird myself. But since assignment is a language intrinsic thing, it cannot be overwritten. == was the next best option because it wasn’t used in Cypher
I will make this update. I flossed over that distinction at the time of writing Pypher.
Parens for Statement objects just comma separate the arguments and then return the Pypher instance.
Again thank you for the feedback/code review. It is very helpful.
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