@@ -227,6 +227,7 @@ def keys(self):
227227 """The keys for the records in this result.
228228
229229 :returns: tuple of key names
230+ :rtype: tuple
230231 """
231232 return self ._keys
232233
@@ -249,7 +250,7 @@ def single(self):
249250 A warning is generated if more than one record is available but
250251 the first of these is still returned.
251252
252- :returns: the next :class:`.Record` or :const:`None` if none remain
253+ :returns: the next :class:`neo4j .Record` or :const:`None` if none remain
253254 :warns: if more than one record is available
254255 """
255256 records = list (self ) # TODO: exhausts the result with self.consume if there are more records.
@@ -277,42 +278,47 @@ def peek(self):
277278
278279 return None
279280
280- # See Record class for available methods.
281-
282- # NOT IN THE API
283-
284281 def graph (self ):
285- """Return a Graph instance containing all the graph objects
282+ """Return a :class:`neo4j.graph. Graph` instance containing all the graph objects
286283 in the result. After calling this method, the result becomes
287284 detached, buffering all remaining records.
288285
289- :returns: result graph
286+ :returns: a result graph
287+ :rtype: :class:`neo4j.graph.Graph`
290288 """
291289 self ._buffer_all ()
292290 return self ._hydrant .graph
293291
294- # def value(self, item=0, default=None):
295- # """Return the remainder of the result as a list of values.
296- #
297- # :param item: field to return for each remaining record
298- # :param default: default value, used if the index of key is unavailable
299- # :returns: list of individual values
300- # """
301- # return [record.value(item, default) for record in self._records()]
302-
303- # def values(self, *items):
304- # """Return the remainder of the result as a list of tuples.
305- #
306- # :param items: fields to return for each remaining record
307- # :returns: list of value tuples
308- # """
309- # return [record.values(*items) for record in self._records()]
310-
311- # def data(self, *items):
312- # """Return the remainder of the result as a list of dictionaries.
313- #
314- # :param items: fields to return for each remaining record
315- # :returns: list of dictionaries
316- # """
317- # return [record.data(*items) for record in self]
292+ def value (self , key = 0 , default = None ):
293+ """Helper function that return the remainder of the result as a list of values.
294+
295+ See :class:`neo4j.Record.value`
296+
297+ :param key: field to return for each remaining record. Obtain a single value from the record by index or key.
298+ :param default: default value, used if the index of key is unavailable
299+ :returns: list of individual values
300+ :rtype: list
301+ """
302+ return [record .value (key , default ) for record in self ]
303+
304+ def values (self , * keys ):
305+ """Helper function that return the remainder of the result as a list of values lists.
318306
307+ See :class:`neo4j.Record.values`
308+
309+ :param keys: fields to return for each remaining record. Optionally filtering to include only certain values by index or key.
310+ :returns: list of values lists
311+ :rtype: list
312+ """
313+ return [record .values (* keys ) for record in self ]
314+
315+ def data (self , * keys ):
316+ """Helper function that return the remainder of the result as a list of dictionaries.
317+
318+ See :class:`neo4j.Record.data`
319+
320+ :param keys: fields to return for each remaining record. Optionally filtering to include only certain values by index or key.
321+ :returns: list of dictionaries
322+ :rtype: list
323+ """
324+ return [record .data (* keys ) for record in self ]
0 commit comments