Skip to content
Prev Previous commit
Next Next commit
Used ABC metaclass
  • Loading branch information
WillAyd committed Jan 24, 2019
commit a154cf3b85c90fc6935bd333520611d2d1d062bc
15 changes: 10 additions & 5 deletions pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pandas.compat as compat
from pandas.compat import (
OrderedDict, add_metaclass, lrange, map, range, string_types, u, zip)
from pandas.errors import AbstractMethodError, EmptyDataError
from pandas.errors import EmptyDataError
from pandas.util._decorators import Appender, deprecate_kwarg

from pandas.core.dtypes.common import (
Expand Down Expand Up @@ -375,20 +375,25 @@ def read_excel(io,
**kwds)


@add_metaclass(abc.ABCMeta)
class _BaseExcelReader(object):

@property
@abc.abstractmethod
def sheet_names(self):
raise AbstractMethodError
pass

@abc.abstractmethod
def get_sheet_by_name(self, name):
raise AbstractMethodError
pass

@abc.abstractmethod
def get_sheet_by_index(self, index):
raise AbstractMethodError
pass

@abc.abstractmethod
def get_sheet_data(self, sheet, convert_float):
raise AbstractMethodError
pass

def parse(self,
sheet_name=0,
Expand Down