Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
versae committed Feb 15, 2015
1 parent e515de9 commit e4ad089
Show file tree
Hide file tree
Showing 7 changed files with 489 additions and 44 deletions.
21 changes: 9 additions & 12 deletions NEWS.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
.. This is your project NEWS file which will contain the release notes.
.. Example: http://www.python.org/download/releases/2.6/NEWS.txt
.. The content of this file, along with README.rst, will appear in your
.. project's PyPI page.

News
====

0.2a1
0.2.0
-----

*Release date: UNRELEASED*
*Release date: 15-Feb-2015*

* Example news entry for the in-development version
* Added documentation.
* Added option to run Cypher queries outside IPython
* Added a better graph plot algorithm for matplotlib.


0.1
---
0.1.0
-----

*Release date: 15-Mar-2010*
*Release date: 17-Nov-2014*

* Example news entry for a released version
* First public release of ``ipython-cypher``

50 changes: 31 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,58 @@ ipython-cypher

:Author: Javier de la Rosa, http://versae.es

Introduces a %cypher (or %%cypher) magic for Neo4j in IPython.
Introduces a ``%cypher`` (and ``%%cypher``) magic for Neo4j in IPython.
Inspired by Catherine Devlin's ipython-sql_.

Connect to a graph database, using neo4jrestclient_ driver, then issue Cypher
Connect to a graph database, using ``neo4jrestclient_`` driver, then issue Cypher
commands within IPython or IPython Notebook. See examples_.

Install
-------
As easy as usual::

pip install ipython-cypher

Then open an IPython or IPython Notebook and load the module
Usage
-----

Inside IPython, load the extension::

%load_ext cypher

By default, it will connect to `http://localhost:7474/db/data`
And then you are reay to go by using the ``%cypher`` cell magic::

%cypher MATCH (a)-[]-(b) RETURN a, b

Some Cypher queries can be very long, in those cases the the line magic,
``%%cypher`` comes in handy::

%%cypher
match (n) return id(n) as id, n.name as name skip 1 limit 3
create
// Nodes
(Neo:Crew {name:'Neo'}),
(Morpheus:Crew {name: 'Morpheus'}),
(Trinity:Crew {name: 'Trinity'}),
// Relationships
(Neo)-[:KNOWS]->(Morpheus),
(Neo)-[:LOVES]->(Trinity),

Note that by default ``ipython-cypher`` will connect to ``http://localhost:7474/db/data``.

%cypher match (n) return id(n) as id, n.name as name skip 1 limit 3
Queries results can be stored in a variable and then converted to a Pandas
``DataFrame``::

results = %cypher match (n) return id(n) as id, n.name as name skip 1 limit 3
results.dataframe()
results = %cypher MATCH (a)-[]-(b) RETURN a, b
results.get_dataframe()

results.pie()
Or to a NetworkX ``DiGraph``::

More soon...
results.get_graph()

More more detailed descriptions, please visit the official documentation_.

Credits
-------
- Distribute_
- Buildout_
- modern-package-template_

.. _Distribute: http://pypi.python.org/pypi/distribute
.. _Buildout: http://www.buildout.org/
.. _modern-package-template: http://pypi.python.org/pypi/modern-package-template
.. _ipython-sql: https://github.com/catherinedevlin/ipython-sql
.. _examples: http://nbviewer.ipython.org/github/versae/ipython-cypher/blob/master/src/examples.ipynb
.. _neo4jrestclient: https://pypi.python.org/pypi/neo4jrestclient
.. _documentation: http://ipython-cypher.readthedocs.org/en/latest/
.. _ipython-sql: https://github.com/catherinedevlin/ipython-sql
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
# documentation.
html_theme_options = {
'logo': 'logo.png',
'logo_text_align': 'left',
'github_user': 'versae',
'github_repo': 'ipython-cypher',
}
Expand Down Expand Up @@ -259,7 +260,7 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'IPythonCypher', u'IPython Cypher Documentation',
u'Javier de la Rosa', 'IPythonCypher', 'One line description of project.',
u'Javier de la Rosa', 'IPythonCypher', 'IPython Extension for Neo4j Cypher.',
'Miscellaneous'),
]

Expand Down
13 changes: 6 additions & 7 deletions docs/cypher.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
API
===

:mod:`cypher` Package
-------------------------

Expand All @@ -6,6 +9,7 @@
:undoc-members:
:show-inheritance:


:mod:`run` Module
-----------------

Expand All @@ -23,6 +27,7 @@
:undoc-members:
:show-inheritance:


:mod:`column_guesser` Module
----------------------------

Expand All @@ -31,6 +36,7 @@
:undoc-members:
:show-inheritance:


:mod:`parse` Module
-------------------

Expand All @@ -39,13 +45,6 @@
:undoc-members:
:show-inheritance:

:mod:`utils` Module
-------------------

.. automodule:: cypher.utils
:members:
:undoc-members:
:show-inheritance:

:mod:`connection` Module
------------------------
Expand Down

0 comments on commit e4ad089

Please sign in to comment.