Skip to content

Commit

Permalink
Merge pull request #36 from fuhrysteve/simplify_get_data
Browse files Browse the repository at this point in the history
lower the complexity of pyexcel_io.io.get_data a bit
  • Loading branch information
chfw committed May 16, 2017
2 parents 0d1d1ab + 6918d09 commit e77fe85
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pyexcel_io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ def get_data(afile, file_type=None, streaming=False, **keywords):
:param keywords: any other library specific parameters
:returns: an ordered dictionary
"""
if isstream(afile) and file_type is None:
file_type = constants.FILE_FORMAT_CSV
if isstream(afile):
data = load_data(file_stream=afile,
file_type=file_type, **keywords)
file_type=file_type or constants.FILE_FORMAT_CSV,
**keywords)
else:
if afile is not None and file_type is not None:
data = load_data(file_content=afile,
if afile is None or file_type is None:
data = load_data(file_name=afile,
file_type=file_type, **keywords)
else:
data = load_data(file_name=afile,
data = load_data(file_content=afile,
file_type=file_type, **keywords)
if streaming is False:
for key in data.keys():
Expand Down

0 comments on commit e77fe85

Please sign in to comment.