SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
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...
 
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...
 
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
 
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
 
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...
 
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?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

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