SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
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 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
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
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
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
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
https://pypi.python.org/pypi/py2neo
~
https://github.com/nigelsmall/py2neo
py2neo 1.6 @technige

Contenu connexe

Tendances

Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
Anderson Dantas
 
자바스터디 4
자바스터디 4자바스터디 4
자바스터디 4
jangpd007
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
Nat Weerawan
 

Tendances (19)

Five
FiveFive
Five
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
 
자바스터디 4
자바스터디 4자바스터디 4
자바스터디 4
 
Fun with processes - lightning talk
Fun with processes - lightning talkFun with processes - lightning talk
Fun with processes - lightning talk
 
Crawler 2
Crawler 2Crawler 2
Crawler 2
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in Elixir
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with PuppetPuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
 
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with PuppetPuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet
 
P3 2018 python_regexes
P3 2018 python_regexesP3 2018 python_regexes
P3 2018 python_regexes
 
The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189
 
P4 2018 io_functions
P4 2018 io_functionsP4 2018 io_functions
P4 2018 io_functions
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
Scaling FastAGI Applications with Go
Scaling FastAGI Applications with GoScaling FastAGI Applications with Go
Scaling FastAGI Applications with Go
 
并发模型介绍
并发模型介绍并发模型介绍
并发模型介绍
 
The Ring programming language version 1.6 book - Part 42 of 189
The Ring programming language version 1.6 book - Part 42 of 189The Ring programming language version 1.6 book - Part 42 of 189
The Ring programming language version 1.6 book - Part 42 of 189
 
Openpear Project の紹介
Openpear Project の紹介Openpear Project の紹介
Openpear Project の紹介
 
Pyspark
PysparkPyspark
Pyspark
 
Meet.js promises
Meet.js promisesMeet.js promises
Meet.js promises
 

Similaire à Neotool (using py2neo from the command line)

Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code Lab
Colin Su
 
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QAFest
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
patter
 

Similaire à Neotool (using py2neo from the command line) (20)

Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code Lab
 
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
 
Python - File operations & Data parsing
Python - File operations & Data parsingPython - File operations & Data parsing
Python - File operations & Data parsing
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
JIP Pipeline System Introduction
JIP Pipeline System IntroductionJIP Pipeline System Introduction
JIP Pipeline System Introduction
 
pyscript_django.pdf
pyscript_django.pdfpyscript_django.pdf
pyscript_django.pdf
 
Perforce Object and Record Model
Perforce Object and Record Model  Perforce Object and Record Model
Perforce Object and Record Model
 
Django productivity tips and tricks
Django productivity tips and tricksDjango productivity tips and tricks
Django productivity tips and tricks
 
Django crush course
Django crush course Django crush course
Django crush course
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in Perl
 
What is the best full text search engine for Python?
What is the best full text search engine for Python?What is the best full text search engine for Python?
What is the best full text search engine for Python?
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Language enhancement in ColdFusion 8
Language enhancement in ColdFusion 8Language enhancement in ColdFusion 8
Language enhancement in ColdFusion 8
 
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
 
Go Web Development
Go Web DevelopmentGo Web Development
Go Web Development
 
Overloading Perl OPs using XS
Overloading Perl OPs using XSOverloading Perl OPs using XS
Overloading Perl OPs using XS
 
Powering your website with realtime data
Powering your website with realtime dataPowering your website with realtime data
Powering your website with realtime data
 
Using Netconf/Yang with OpenDalight
Using Netconf/Yang with OpenDalightUsing Netconf/Yang with OpenDalight
Using Netconf/Yang with OpenDalight
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Neotool (using py2neo from the command line)

  • 1. neotool (using py2neo from the command line) py2neo 1.6 @technige
  • 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. 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. 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. 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. 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