Skip to content

Commit

Permalink
interface update
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Dec 7, 2014
1 parent c352b32 commit f8321ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Write to an xls file
>>> from pyexcel.ext.xls import OrderedDict


Here's the sample code to write a dictionary to an xl file::
Here's the sample code to write a dictionary to an xls file::

>>> from pyexcel_xls import XLWriter
>>> data = OrderedDict() # from collections import OrderedDict
Expand Down Expand Up @@ -81,7 +81,7 @@ Here's the sample code::
Write an xls to memory
**********************

Here's the sample code to write a dictionary to an xl file::
Here's the sample code to write a dictionary to an xls file::

>>> from pyexcel_xls import XLWriter
>>> data = OrderedDict()
Expand All @@ -102,7 +102,7 @@ Read from an xls from memory
Continue from previous example::

>>> # This is just an illustration
>>> # In reality, you might deal with xl file upload
>>> # In reality, you might deal with xls file upload
>>> # where you will read from requests.FILES['YOUR_XL_FILE']
>>> book = XLBook(None, io.getvalue())
>>> print(json.dumps(book.sheets()))
Expand All @@ -118,7 +118,7 @@ Import it in your file to enable this plugin::

Please note only pyexcel version 0.0.4+ support this.

Reading from an xl file
Reading from an xls file
************************

Here is the sample code::
Expand All @@ -140,7 +140,7 @@ Here is the sample code::
| row 1 | row 2 | row 3 |
+-------+-------+-------+

Writing to an xl file
Writing to an xls file
**********************

Here is the sample code::
Expand All @@ -153,7 +153,7 @@ Reading from a IO instance
You got to wrap the binary content with stream to get xls working::

>>> # This is just an illustration
>>> # In reality, you might deal with xl file upload
>>> # In reality, you might deal with xls file upload
>>> # where you will read from requests.FILES['YOUR_XL_FILE']
>>> xlfile = "another_file.xls"
>>> with open(xlfile, "rb") as f:
Expand Down
5 changes: 4 additions & 1 deletion pyexcel_xls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ class XLSheet(SheetReader):
"""
def __init__(self, sheet):
SheetReader.__init__(self, sheet)
self.name = sheet.name

@property
def name(self):
return self.native_sheet.name

def number_of_rows(self):
"""
Expand Down

0 comments on commit f8321ad

Please sign in to comment.