Skip to main content

cy2py: seamless Neo4j integration in Python Notebooks

Install

To install, run: pip install cy2py

Or clone this repository and run: python setup.py install

How you can use it

You can use cy2py in two ways:

  • as a line magic, it returns a Python dataframe that you can than manipulate as you wish

  • as cell magic that will print a graph or dataframe if the result is tabular

Magic arguments

You can check the list of accepted arguments by running the following command:

%cypher?

%cypher [-a ALIAS] [-u URI] [-us USERNAME] [-pw PASSWORD] [-db DATABASE]
              [-q QUERY] [-p PARAMS] [-c CLOSE] [-co COLORS] [-ca CAPTIONS]
              [-la LAYOUT] [-l]

optional arguments:
  -a ALIAS, --alias ALIAS
                        The Neo4j connection configuration alias. You after
                        you defined it the first time in combination with the
                        other arguments you can use only it to connect to the
                        Neo4j instance without repassing the arguments each
                        time. If you don't specify it the first time you'll
                        pass the config it'll became the default for each
                        connection
  -u URI, --uri URI     The Neo4j URI. You can use this kind of URI in order
                        to define a specific database to query:
                        neo4j://localhost:7687/my-db
  -us USERNAME, --username USERNAME
                        The Neo4j User
  -pw PASSWORD, --password PASSWORD
                        The Neo4j Password
  -db DATABASE, --database DATABASE
                        The Neo4j Database, if not provided we use the default
  -q QUERY, --query QUERY
                        Pass the Cypher query as argument. Valid only when you
                        use line magic.
  -p PARAMS, --params PARAMS
                        A map of Cypher query parameters
  -c CLOSE, --close CLOSE
                        Close a Driver connection by alias or URI
  -co COLORS, --colors COLORS
                        A map label/color
  -ca CAPTIONS, --captions CAPTIONS
                        A map label/caption
  -la LAYOUT, --layout LAYOUT
                        A map for layout configuration
  -l, --list            List active configurations

Example

Under the examples directory you'll find a Google Colab notebook that shows how to use cy2py in order to dive into a Neo4j crime dataset showing also how is easy to seamlessly leverage other visualization libraries such as Ploty.

Metadata

Release files for cy2py 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cy2py 1.1.6
File Size Uploaded
cy2py-1.1.6.tar.gz 8.5 kB Details

Release files / cy2py-1.1.6.tar.gz

Download URL cy2py-1.1.6.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f1127bd418df07dbef61e8abdd9dcd69429922875f805a10ed48f2cc427daeb4
BLAKE2b-256 checksum
How to use checksums
059d44cc9d8ccd4536029cebd4e09530c980012f96f3787898e3814901d1bed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.1.6 This release

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page