Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
neotool
(using py2neo from the command line)
py2neo 1.6 @technige
Usage
$ neotool <options> <command> <args>
$ python -m py2neo.tool <options> <command> <args>
clear Clear all nodes and re...
abba.xml
<?xml version="1.0" encoding="UTF-8" ?>
<group id="abba">
<member id="agnetha">
<name>Agnetha Fältskog</name><bir...
XML to Geoff
$ neotool xml-geoff abba.xml
(abba)
(agnetha {"birth date":"1950-04-05","name":"Agnetha Fältskog"})
(björn {"...
Loading Geoff
$ neotool geoff-insert abba.geoff
$ neotool geoff-merge abba.geoff
waterloo (63 {"length sec":42,"length min...
Cypher Queries
$ neotool cypher "START a=node(68) MATCH a-->b RETURN b"
b
------------------------------------------------...
https://pypi.python.org/pypi/py2neo
~
https://github.com/nigelsmall/py2neo
py2neo 1.6 @technige
Upcoming SlideShare
Loading in …5
×

Neotool (using py2neo from the command line)

2,887 views

Published on

Neotool is a command line utility that ships with Py2neo and provides facilities for Cypher execution, Geoff imports and XML to Geoff conversion. These slides are from a Neo4j lightning talk on 29 Aug 2013 and are based on the upcoming Py2neo 1.6 release.

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

Neotool (using py2neo from the command line)

  1. 1. neotool (using py2neo from the command line) py2neo 1.6 @technige
  2. 2. Usage $ neotool <options> <command> <args> $ python -m py2neo.tool <options> <command> <args> clear Clear all nodes and relationships cypher <query> Execute Cypher query and output as text cypher-csv <query> Execute Cypher query and output as CSV cypher-geoff <query> Execute Cypher query and output as Geoff cypher-json <query> Execute Cypher query and output as JSON cypher-tsv <query> Execute Cypher query and output as tab separated values geoff-insert <file> Insert Geoff data geoff-merge <file> Merge Geoff data xml-geoff <file> Convert XML data to Geoff data py2neo 1.6 @technige
  3. 3. abba.xml <?xml version="1.0" encoding="UTF-8" ?> <group id="abba"> <member id="agnetha"> <name>Agnetha Fältskog</name><birth date="1950-04-05" /> </member> <member id="björn"> <name>Björn Ulvaeus</name><birth date="1945-04-25" /> </member> <member id="benny"> <name>Benny Andersson</name><birth date="1946-12-16" /> </member> <member id="frida"> <name>Anni-Frid Lyngstad</name><birth date="1945-11-15" /> </member> <song id="waterloo" release_date="1974-03-04"> <name>Waterloo</name><length min="2" sec="42" /> </song> </group> py2neo 1.6 @technige
  4. 4. XML to Geoff $ neotool xml-geoff abba.xml (abba) (agnetha {"birth date":"1950-04-05","name":"Agnetha Fältskog"}) (björn {"birth date":"1945-04-25","name":"Björn Ulvaeus"}) (benny {"birth date":"1946-12-16","name":"Benny Andersson"}) (frida {"birth date":"1945-11-15","name":"Anni-Frid Lyngstad"}) (waterloo {"length min":2,"length sec":42,"name":"Waterloo"}) (abba)-[:member]->(agnetha) (abba)-[:member]->(björn) (abba)-[:member]->(benny) (abba)-[:member]->(frida) (abba)-[:song {"release_date":"1974-03-04"}]->(waterloo) py2neo 1.6 @technige
  5. 5. Loading Geoff $ neotool geoff-insert abba.geoff $ neotool geoff-merge abba.geoff waterloo (63 {"length sec":42,"length min":2,"name":"Waterloo"}) abba (68) björn (66 {"name":"Björn Ulvaeus","birth date":"1945-04-25"}) benny (65 {"name":"Benny Andersson","birth date":"1946-12-16"}) frida (64 {"name":"Anni-Frid Lyngstad","birth date":"1945-11-15"}) agnetha (67 {"name":"Agnetha Fältskog","birth date":"1950-04-05"}) py2neo 1.6 @technige
  6. 6. Cypher Queries $ neotool cypher "START a=node(68) MATCH a-->b RETURN b" b ----------------------------------------------------------------- (67 {"name":"Agnetha Fältskog","birth date":"1950-04-05"}) (66 {"name":"Björn Ulvaeus","birth date":"1945-04-25"}) (65 {"name":"Benny Andersson","birth date":"1946-12-16"}) (64 {"name":"Anni-Frid Lyngstad","birth date":"1945-11-15"}) (63 {"length sec":42,"length min":2,"name":"Waterloo"}) (5 rows) py2neo 1.6 @technige
  7. 7. https://pypi.python.org/pypi/py2neo ~ https://github.com/nigelsmall/py2neo py2neo 1.6 @technige

×