Package: neo4jrestclient
Neo4j Python REST Clientsynopsis:Object-oriented Python library to interact with Neo4j standalone REST server.The first objective of Neo4j Python REST Client is to make transparent for
Python programmers the use of a local database throughpython-embeddedor a
remote database thanks to Neo4j REST Server. So, the syntax of this API is
fully compatible with python-embedded. However, a new syntax is introduced in
order to reach a more pythonic style.InstallationAvailable throught Python Package Index:$ pip install neo4jrestclientOr:$ easy_install neo4jrestclientGetting startedThe main class isGraphDatabase, exactly how inpython-embedded:>>>fromneo4jrestclient.clientimportGraphDatabase>>>gdb=GraphDatabase("http://localhost:7474/db/data/")Due to the syntax is fully compatible withpython-embedded, the next lines only show
the commands added and its differences.Creating a node:>>>n=gdb.nodes.create()# Equivalent to>>>n=gdb.node()Specify properties for new node:>>>n=gdb.nodes.create(color="Red",width=16,height=32)Accessing properties:>>>value=n['key']# Get property value>>>n['key']=value# Set property valueCreate relationship:>>>n1.relationships.create("Knows",n2)# Useful when the name of# relationship is stored in a variableSpecify properties for new relationships:>>>n1.Knows(n2,since=123456789,introduced_at="Christmas party")DocumentationFor the extended and latest version of the documentation, please, visit theread the docssiteChanges2.1.1 (2015-11-20)Add dockerized travisFix #119. Allow labels create nodes directlyFix #122. Problem clearing labels of a node. Fix also a cache issue. Update travis to run python 3.4 and Neo4j verionsAdd more serialization support for extensions2.1.0 (2014-11-17)Fix pip install errorRemove lucene-querybuilder as dependencyAdd stats for query executionAdd support for resultDataContents param in the transactional Cypher endpointFix #116. Although the old reference is still kept, the object does not exist
in server and will failAdd Neo4j 2.1.5 to travisFixes issues #109 and #114, related to a memory leak in query transactionsFix #113. Add a way to cast query results from collection functions in CypherChange .iteritems to items for Python 3 compatibilityChange to enterprise for testingFix URI_REWRITES option. Remove testing for 1.7.2, and add 2.1.4.Fix the download script for Neo4j, neo4j-clean-remote-db-addon no longer used.Add uri rewrites as a work around neo4j issue #2985Some pruning bugsLabels url is stored in node_labels settings keyFixed bug in prune function: it didn’t return the self objectFixed bug for prunning with JS code: added the case in traverse method for
prunning based on an arbitrary Javascript code.2.0.4 (2014-06-20)TyposBugfixesDrop support for 1.6 branch2.0.3 (2014-05-16)Update travis to test Neo4j versions 1.9.7 and 2.0.3Fix #104. Keep backwards compatibility for ‘nullable’ prior 2.0
It will be deprecated for Neo4j>=2.0.0Update Q class for nullable=TrueFix un/pickling extenionsRefactorize get auth information from the connection URLUpdate queries.rst (typo)Fix the lazy loading of extensions2.0.2 (2014-04-04)Add Pickle support for GraphDatabase objectsAdd small control to change display property in IPythonAdd a new parameter to auto_execute transactions in one single requestFix auto transaction in Cypher queries for Neo4j versions prior 2.0The non transactional Cypher will be removed eventually, so we create now
a transaction per query automaticallyExperimental support for IPython Notebook renderingFix #101. Fix a problem when accessing node properties inside transaction
for queries2.0.1 (2014-03-23)Fix coveralls for TravisFix #100. Fixes rollback problem when outside a with statementUpdate Neo4j versions for testingRemove inrange test for version 1.7.2 of Neo4jAdd specific test for inrange lookupsFixes #98. Bug due to an incorrect treatment of numbers in eq, equals,
neq, notequals lookupsAdd downloadsSplit exceptions from request.py file to a exceptions.py fileUpdate requirements.txtFix #96, fix dependency versionsFix #95. Support for creating spatial indexes2.0.0 (2013-12-30)Add support for Neo4j 2.0Add Python3 supportRemove Python 2.6 supportAdd support for Cypher transactional endpointAdd documentation for Cypher transactionsAdd support for LabelsAdd documentation for LabelsAdd support to pass Neo4j URL as the host, and neo4j-rest-client will request
for the ‘/db/data’ part in an extra requestAdd option for enabling verification of SSL certificatesFix #94. Disable lazy loading from Cypher queries but keep if for filtersUpdate documentationAdd the option to ‘create’ labels and add nodes to themAdd filtering support for LabelsAdd tests for LabelsBetter structure to organize testsAdd UnitTest.skipIf instead of my own decorator @versionsAdd development requirements and PyPy to TravisAdd flake8Add support for toxSkip some test that depend on newer versions of other dependenciesUpdate README with Coveralls.io imageAdd coverageAdd extra requires for testsEnable syntax highlighting, fix spelling errorsFix #92. Allow nodes to be deleted from index without key or valueFix an error on traversals time_out when decimal values are passedUpdate Neo4j versions for TravisPEP8 reviewAdd .all method to get all the elements. Underneath, it invokes .filter
with no argumentsMerge pull request #85 from carlsonp/patch-11.9.0 (2013-05-27)Add Neo4j 1.9 and 2.0.0-M02 to tests and Travis.Fix Python 2.6 compatibility. Last Python 2.6 issue fixed.Fix test_filter_nodes_complex_lookups test for empty databasesFix get_or_create and create_or_fail tests and add SMART_ERRORS for those functionsAdd support for Neo4j versions when testing in TravisAdd support for get_or_create and create_or_fail index operationsAdding integration tests with Travis-CIUpdated requirements.txt with Shrubbery proposalsAdd experimental support for smart dates1.8.0 (2012-12-09)Updated lucene-querybuilder requirement.Add support for using Indexes as start points when filteringAdd support for using filters in indices.Fixes an error when using cert and key files.Adding order by and filtering for relationships.First implementation of complex filtering and slicing for nodes based on
Cypher.Improving stability of tests.Fixes #74. Added the new .query() method and casting for returns. Also a very
initial .filter method with an special Q object for composing complex filters.Fixes #64, added a small unicode check.Feature cache store and cache extension requests. Every time extension is used
a get request is made before post this only needs to happen once per extension.Allow user to configure own cache engine, (e.g djangos cache).Read test db url from environ.Fixes #71. Pass correct url to get. Get with missing ‘/’ was causing an
additional 302.Support keep-alive / pipelining: httplib now instantiated on module load not
per quest this also fixes caching, when the CACHE option was set a no-cache
header was added that by passed the cache system.Fixes #68. Gremlin query trips on “simple” list, but not an error no
neo4j-rest-client side.Fixes #69. Incorrect node references when splitting transactions.Adding support for retrieving index elements in a transaction.Fixes #66. Ditch exception catch on root fetch at GraphDatabase.__init__().
As per #65, current behaviour when auth fails is that a 401 StatusException
is raised, and caught by this try/except block and a misleading NotFoundError
is raised in its place - lets just let the StatusException through. Unsure
about what other Exceptions may be raised but cannot reproduce.Fixed issue #69. Transaction split.Adding support for retrieving index elements in a transaction.1.7.0 (2012-05-17)Fixing an error when reating relationships with nodes created previously in
a transactions.Fixing typo (self._aith vs self_auth).Fixing #60. Adding support when no port is specified.Fixing an error with unicode property names and indexing.1.6.2 (2012-03-26)Fixing an error indexing with numeric values.Fixing an error indexing with boolean values.Adding initial unicode suppport for indices.
Adding better debug messages to 400 response codes.1.6.1 (2012-02-27)Fixes #29. Adding support for authentication.1.6.0 (2012-02-27)Adding documentation site.Finishing the experimental support for indexing and transactions.Adding preliminar indexing support in trasnsactions.Adding a new way to traverse the graph based on python-embedded.Removing __credits__ in favor of AUTHORS file. Updating version number.Fixes #33. Deprecating the requirement of a reference node.Added methods to bring it in line with the embedded driver.Added .single to Iterable and .items() to Node to bring it into alignment
with the embedded driver.Adding non-functional realtionshos creation inside transactions.New returnable type “RAW”, added in constants. Very useful for Gremlin and
Cypher queries.Extensions can now return raw results. Fixes #52.Added a test for issue #52, returns=RAW.Adding relationships support to transactions.Fixes #49. Usage in extensions.Improving transaction support. Related #49.Fixing some PEP08 warnings.Fixes #43. Unable to reproduce the error.Fixes #49. Improving the batch efficiency in get requests.Fixes #47. Improving Paths management in traversals.Adding ‘content-location’ as possible header in responses instead of
just ‘location’.Fixing an error wwhen the value of a set property operation is None.Merge branch ‘master’ of github.com:versae/neo4j-rest-client into devel.Fix for paginated traversals under Neo4j 1.5.Added check for ‘content-location’ header in PaginatedTraversal, ensuring
traversals don’t stop early with Neo4j 1.5.1.5.0 (2011-10-31)Removing the smart_quote function from indexing. It’s not needed anymore with
the new way to add elements to indices.Fixes #37.Using JSON object to set index key and value.1.4.5 (2011-09-15)Adding more testing to returns parameter in the extensions.Fixes 32. It needs some more testing, maybe.Updated to using lucene-querybuilder 0.1.5 (bugfixes and better wildcard
support).Fixed the test issue found in #34, and updated the REST client to using
lucene-querybuilder 0.1.5.Fixes #34. Fixing dependency of lucene-querybuilder versionFixes #30. Fixing an issue deleting all index entries for a node.Fixing an issue with parameters in extensions.Ensure that self.result is always present on the object, even if it’s None.Fixing naming glitch in exception messageEnsure that self.result is always present on the object, even if it’s NoneFixing an error retrieving relationships in paths.Fixing an error in extensions, Path and Position.1.4.4 (2011-08-17)Merge pull request #28 from mhluongo/masterMade the DeprecationWarnings a bit more specific.Nodes can now be used in set and as dict keys, differentiated by id.Added a test for node hashing on id.Removed the ‘Undirected’ reference from tests to avoid a DepreactionWarning.Moved the relationship creation DeprecationWarning so creating a relationship
the preferred way won’t raise it.Got rid of the DeprecationWarning on import- moved in to whenever using
Undirected.*.Fixed traversal return filters.Enabled return filters, including those with custom javascript bodies.
Eventually a more elegant (Python instead of string based) solution for
return filter bodies is in order.Fixed a mispelling in the test_traversal_return_filter case.Added a test for builtin and custom traversal return filters.Small bug fix for traversalFixed bug in traverse method for POSITION and PATH return types.1.4.3 (2011-07-28)Added some deprecation warnings.Added support for pickling ans some tests.Fixed an error deleting nodes and relationships on transactions.Finishied and refactored the full unicode support.1.4.2 (2011-07-18)Updated the documentation and version.Added support for indices deletion.Improved Unicode support in properties keys and values and relationships
types. Adding some tests.1.4.1 (2011-07-12)Fixed an error retrieving relationships by id.Added control to handle exceptions raised by Request objects.Updated changes, manifest and readme files.1.4.0 (2011-07-11)Updated version number for the new release.Updated documentation.Updated develpment requirements.Added support for paginated traversals.Passed pyflakes and PEP8 on tests.Added weight to Path class.Index values now quoted_plus.Changed quote to quote_plus for index values.Added two tests for unicode and url chars in index values.Added initial documentacion for transactions.Added the transaction support and several tests.Fixed the implementation of __contains__ in Iterable class for evaluation
of ‘in’ and ‘not in’ expressions.Added documentation for Iterable objects.Added more transactions features.Added requirements file for virtual environments in development.Improved number of queries slicing the returned objects in a Iterable
wrapper class.Added Q syntax for more complicated queries.Added support for the Q query syntax for indexes using the DSL
athttp://github.com/scholrly/lucene-querybuilderFixed an error in the test_query_index case (forgot to include an ‘or’.
between queries).Added lucene-querybuilder to the test requirements in setup.py.Added a test case for Q-based queries.1.3.4 (2011-06-22)Fixed the setup.py and httplib2 import error during installing.Reordered the options variables in an options.py file.
Allows index.query() to be called with or without a keyFixed issue #15 regarding dependency to httplib2Patched index.query() so it can take a query without a key (to support, say,
mutli-field Lucene queries). Ultimately, query so probably be refactored to
Index (instead of IndexKey) because IndexKey doesn’t actually help with
full-text queries.Fixed for issue #19 (missed that urllib.quote).Altered the test_query_index case to reflect how I think indexing should
work.Using assertTrue instead of failUnless in tests.py, failUnless is deprecated
in 2.7 and up, so I figured we might as well switch.Added SMART_ERRORS (aka “Django mode”). If you set SMART_ERROR to True it
will make the client throw KeyError instead of NotFoundError when a key is
missing.1.3.3 (2011-06-14)Fixed an introspection when the results list of a traverse is empty.Merge pull request #17 from mhluongo/masterResolved the STOP_AT_END_OF_GRAPH traversal test case.
Calling .traverse(stop=STOP_AT_END_OF_GRAPH) will now traverse the graph
without a max depth (and without 500 errors).Added a failing test case for traverse(stop=STOP_AT_END_OF_GRAPH).1.3.2 (2011-05-30)Added a test for deleting relationships.Fixing an Index compatibility issue with Python 2.6.1.Fixing an error in extensions support with named params.1.3.1 (2011-04-16)Fixing setup.py.1.3.0 (2011-04-15)First Python Index Package release with full support for Neo4j 1.3.