pyexcel.readers module

pyexcel.readers

Uniform interface for reading different excel file formats

copyright:
  1. 2014 by C. W.
license:

GPL v3

class pyexcel.readers.CSVReader(file)[source]

csv reader

cell_value(row, column)[source]

Random access to the csv cells

number_of_columns()[source]

Number of columns in the csv file

assuming the length of each row is uniform

number_of_rows()[source]

Number of rows in the csv file

class pyexcel.readers.ColumnFilterableSeriesReader(file)[source]

Bases: pyexcel.readers.GenericSeriesReader

Columns can be filtered but not rows

filter(filter)[source]
class pyexcel.readers.FilterableReader(file)[source]

Bases: pyexcel.readers.Reader

Reader that can be applied one filter

cell_value(row, column)[source]

Random access to the data cells

column_range()[source]
filter(afilter)[source]
number_of_columns()[source]

Number of columns in the data file

number_of_rows()[source]

Number of rows in the data file

row_range()[source]
class pyexcel.readers.GenericSeriesReader(reader)[source]

Bases: pyexcel.readers.FilterableReader

For data with column headers

x y z 1 2 3 4 5 6

This class has a default filter that filter out row 0 as headers. Extra functions were added to return headers at row 0

named_column_at(name)[source]
series()[source]
class pyexcel.readers.ODSReaderImp(file)[source]

Bases: pyexcel.readers.CSVReader

ods reader

Currently only support first sheet in the file

class pyexcel.readers.Reader(file)[source]

Wrapper class to unify csv, xls and xlsx reader

cell_value(row, column)[source]

Random access to the data cells

column_at(index)[source]

Returns an array that collects all data at the specified column

column_range()[source]

Utility function to get column range

columns()[source]

Returns a column iterator to go through each column from left to right

contains(predicate)[source]
enumerate()[source]

Default iterator to go through each cell one by one from top row to bottom row and from left to right

number_of_columns()[source]

Number of columns in the data file

number_of_rows()[source]

Number of rows in the data file

rcolumns()[source]

Returns a column iterator to go through each column from right to left

reverse()[source]

Reverse iterator to go through each cell one by one from bottom row to top row and from right to left

row_at(index)[source]

Returns an array that collects all data at the specified row

row_range()[source]

Utility function to get row range

rows()[source]

Returns a row iterator to go through each row from top to bottom

rrows()[source]

Returns a row iterator to go through each row from bottom to top

rvertical()[source]

Default iterator to go through each cell one by one from rightmost column to leftmost row and from bottom to top

vertical()[source]

Default iterator to go through each cell one by one from leftmost column to rightmost row and from top to bottom

class pyexcel.readers.SeriesReader(file)[source]

Bases: pyexcel.readers.GenericSeriesReader

rows other than header row can be filtered. row number has been shifted by 1 as header row is protected.

columns can be filtered.

filter(afilter)[source]
named_column_at(name)[source]
series()[source]
class pyexcel.readers.StaticSeriesReader(file)[source]

Bases: pyexcel.readers.GenericSeriesReader

Static Series Reader. No filters can be applied.

class pyexcel.readers.XLSReader(file)[source]

xls reader

Currently only support first sheet in the file

cell_value(row, column)[source]

Random access to the xls cells

number_of_columns()[source]

Number of columns in the xls file

number_of_rows()[source]

Number of rows in the xls file