Skip to main content

No project description provided

Project description

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 listo of accepted arguments by running the following command:

%cypher?

%cypher [-a ALIAS] [-u URI] [-us USERNAME] [-pw PASSWORD] [-db DATABASE]
              [-q QUERY] [-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.
  -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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cy2py-1.1.0.tar.gz (386.1 kB view details)

Uploaded Source

File details

Details for the file cy2py-1.1.0.tar.gz.

File metadata

  • Download URL: cy2py-1.1.0.tar.gz
  • Upload date:
  • Size: 386.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for cy2py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b12f8a6c9f495e0efca3422e9d929fdc2ec220245bd1290a1ea0e06237bd6600
MD5 b8ae08fb0067d4bd9aa6b6b94e61f96a
BLAKE2b-256 989a278de4f14fdd7ed011f5e0b71f1f73f2f8d15d23aa087eea052ac4f69083

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page