Commits

Panagiotis Mavrogiorgos committed 7deebf5

Add method `get_rows` to the `Reader` class.

Comments (0)

Files changed (1)

csvmodels/base.py

         Returns the csv data as a dictionary with keys the attributes of the
         :py:class:`RowModel` and values the column data as lists.
         """
-        try:
-            rows = [row for row in self]
-        except StopIteration:
-            pass
+        rows = self.get_rows()
 
         names = self.row_cls._column_names
         data = {name: list() for name in names}
 
         return data
 
+    def get_rows(self):
+        """
+        Returns the csv data as a list of :py:class:`RowModel` instances.
+
+        """
+        try:
+            rows = [row for row in self]
+        except StopIteration:
+            pass
+
+        return rows
+
 
 class Writer:
     def __init__(self, row_cls, file):