vesoft-inc / nebula-python

Client API of Nebula Graph in Python
194 stars 76 forks source link

ipython-ngql, a PoC of Jupyter extension to enable nGQL queries like %ngql SHOW SPACES #86

Closed wey-gu closed 6 months ago

wey-gu commented 3 years ago

Dear all,

First, I felt really grateful that you accepted my first PR, thanks so much, it means a lot to me! 😁

When thinking about python ng users, I came to an idea that there could be cases they would like to make queries or tweak data from Jupyter Notebooks, and it turned out there are indeed such things out there for SQL-DB or Cypher.

Thus I spent some time during the weekend creating a PoC on this topic, with which, we could do something like the below image showed to query and manipulate ng's data inside Jupyter notebooks, this enables data scientists to share rerunnable/ readable notebooks with rendered Markdown descriptions, machine learning python codes and results together with nebula graph nGQL querying and results(as human-readable output by default, as image-0), with native python integrations(supports variable in nGQL yields local python variables, as image-1).

image-0, an example of a query in a Jupyter notebook image-0

image-1, example on local variable rendered in nGQL lines image-1

The code was put here with more details and it's in a demo shape only (no tests, only tried with a few basic queries). You could try it out(pip install ipython-ngql in your iPython/Jupyter Notes if you promise not to use too fancy queries to break the humble PoC code 😛.

What do you think about this, please? I registered the PyPi name as ipython-ngql while if the plan is going to use it as this separate package, I will hand over the ownership to the community. Or maybe it's possible to consider implementing this in the nebula-python repo itself and not only support %ngql <query> but also %opencypher <query> in the future 😉.

Thanks a lot! BR//Wey

whitewum commented 3 years ago

Great! I like it very much.

Notebook support is more friendly for data scientists.

As well as networkx.

wey-gu commented 3 years ago

Great! I like it very much.

Notebook support is more friendly for data scientists.

As well as networkx.

Thanks Min!

Wow, networkX is next level, now I come to know using nX is the best practice for data scientists here already☺️.

laura-ding commented 3 years ago

@wey-gu Thanks for your contribution! The idea is feasible. But it's the same work of console, I don't think It is necessary to do it, because the data format is the reduce work. and use this, it needs to download so many dependencies. We will plan to provide something like Py2neo. Do you interested in contributing to this?

wey-gu commented 3 years ago

@wey-gu Thanks for your contribution! The idea is feasible. But it's the same work of console, I don't think It is necessary to do it, because the data format is the reduce work. and use this, it needs to download so many dependencies. We will plan to provide something like Py2neo. Do you interested in contributing to this?

Dear Laura,

Thanks a lot! Sure, agreed it's too heavy yet with little gain for bringing it to the nebula-python repo. I will leave it as it is in my own repo and PyPI for now, maybe put some free time on polishing it in case someone would like to use it/ or even contribute to it, too.

Regarding the Py2neo-like package, the plan will be more CLI tool part right? I was thinking of creating something like iRedis, an interactive CLI client for ng, is it similar to the plan? Either way, as a CLI enthusiast, yes, I am for sure interested in contributing to it! ☺️

We can have a further talk via Slack or? It's ok to close this issue!

Thanks again~ BR, Wey

whitewum commented 3 years ago

Py2neo

is much more like an ORM SDK.

wey-gu commented 3 years ago

Py2neo

is much more like an ORM SDK.

Thanks, Min, got it :). nebula python ORM is much more meaningful for the python SDK field.

laura-ding commented 3 years ago

@wey-gu Thanks for your contribution! The idea is feasible. But it's the same work of console, I don't think It is necessary to do it, because the data format is the reduce work. and use this, it needs to download so many dependencies. We will plan to provide something like Py2neo. Do you interested in contributing to this?

Dear Laura,

Thanks a lot! Sure, agreed it's too heavy yet with little gain for bringing it to the nebula-python repo. I will leave it as it is in my own repo and PyPI for now, maybe put some free time on polishing it in case someone would like to use it/ or even contribute to it, too.

Regarding the Py2neo-like package, the plan will be more CLI tool part right? I was thinking of creating something like iRedis, an interactive CLI client for ng, is it similar to the plan? Either way, as a CLI enthusiast, yes, I am for sure interested in contributing to it! ☺️

We can have a further talk via Slack or? It's ok to close this issue!

Thanks again~ BR, Wey

@wey-gu Thanks very much for your attention to it. We will collect the requirement and write the design into the document, and then put it out to share. I am very glad that you can join in in the future.

wey-gu commented 3 years ago

Dear @laura-ding

@wey-gu Thanks very much for your attention to it. We will collect the requirement and write the design into the document, and then put it out to share. I am very glad that you can join in in the future.

Got it, thanks! :-D

wey-gu commented 6 months ago

iPython-nGQL is no longer a PoC, it's actively maintained! Closing this issue.