-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Hey there :)!
If possible may we please have cypher
as a selectable language option in VS Code notebooks (.ipynb
files).
We can already run cypher in notebook cells (see further below to see how!),
It is just that the code syntax highlighting is not available!
VS Code lets you manually set the language by clicking here
But currently cypher does not show up in the options list;
I have been setting up a custom cell magic as follows:
First notebook cell:
from IPython.core.magic import register_cell_magic
from neo4j import Neo4jDriver
import pandas as pd
def read_pandas(cypher:str) -> pd.DataFrame:
# ... see https://neo4j.com/docs/python-manual/current/transformers/#_transform_to_pandas_dataframe
_ = None
@register_cell_magic
def cypher(line, cell):
global _
_ = read_pandas(cell)
display(_)
Second notebook cell
This extension could be adjusted so that this next cell can have proper cypher syntax highlighting in vs code!
%%cypher
RETURN "Hello Neo4j!" as result
result
0 Hello Neo4j!
Third Notebook Cell
print("The first result was "+_.iloc[0,0])
The first result was Hello Neo4j!
Metadata
Metadata
Assignees
Labels
No labels