Skip to content

Commit

Permalink
reverted to flask based extension management. pkgutil and namespace p…
Browse files Browse the repository at this point in the history
…ackages do not fit well with the development though their import statement looks attractive
  • Loading branch information
chfw committed Dec 5, 2014
1 parent 27fbfac commit fecf468
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 217 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
*.pyc
*~
.coverage
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -12,7 +12,7 @@ python:
install:
- python setup.py install
- pip install git+https://github.com/chfw/pyexcel.git
- pip install git+https://github.com/chfw/pyexcel.ioext.git
- pip install git+https://github.com/chfw/pyexcel_io.git
- pip install -r tests/requirements.txt
script:
make test
Expand Down
50 changes: 25 additions & 25 deletions README.rst
@@ -1,36 +1,36 @@
===========
pyexcel-xl
pyexcel-xls
===========

.. image:: https://api.travis-ci.org/chfw/pyexcel-xl.png
:target: http://travis-ci.org/chfw/pyexcel-xl
.. image:: https://api.travis-ci.org/chfw/pyexcel-xls.png
:target: http://travis-ci.org/chfw/pyexcel-xls

.. image:: https://coveralls.io/repos/chfw/pyexcel-xl/badge.png?branch=master
:target: https://coveralls.io/r/chfw/pyexcel-xl?branch=master
.. image:: https://coveralls.io/repos/chfw/pyexcel-xls/badge.png?branch=master
:target: https://coveralls.io/r/chfw/pyexcel-xls?branch=master

.. image:: https://pypip.in/d/pyexcel-xl/badge.png
:target: https://pypi.python.org/pypi/pyexcel-xl
.. image:: https://pypip.in/d/pyexcel-xls/badge.png
:target: https://pypi.python.org/pypi/pyexcel-xls

.. image:: https://pypip.in/py_versions/pyexcel-xl/badge.png
:target: https://pypi.python.org/pypi/pyexcel-xl
.. image:: https://pypip.in/py_versions/pyexcel-xls/badge.png
:target: https://pypi.python.org/pypi/pyexcel-xls

.. image:: https://pypip.in/implementation/pyexcel-xl/badge.png
:target: https://pypi.python.org/pypi/pyexcel-xl
.. image:: https://pypip.in/implementation/pyexcel-xls/badge.png
:target: https://pypi.python.org/pypi/pyexcel-xls

**pyexcel-xl** is a tiny wrapper library to read, manipulate and write data in xls format and it can read xlsx and xlsm fromat. You are likely to use it with `pyexcel <https://github.com/chfw/pyexcel>`_.
**pyexcel-xls** is a tiny wrapper library to read, manipulate and write data in xls format and it can read xlsx and xlsm fromat. You are likely to use it with `pyexcel <https://github.com/chfw/pyexcel>`_.

Installation
============

You can install it via pip::

$ pip install pyexcel-xl
$ pip install pyexcel-xls


or clone it and install it::

$ git clone http://github.com/chfw/pyexcel-xl.git
$ cd pyexcel-xl
$ git clone http://github.com/chfw/pyexcel-xls.git
$ cd pyexcel-xls
$ python setup.py install

Usage
Expand All @@ -39,7 +39,7 @@ Usage
As a standalone library
------------------------

Write to an xl file
Write to an xls file
*********************

.. testcode::
Expand All @@ -50,25 +50,25 @@ Write to an xl file
... from StringIO import StringIO
... else:
... from io import BytesIO as StringIO
>>> from pyexcel.ext.xl import OrderedDict
>>> from pyexcel.ext.xls import OrderedDict


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

>>> from pyexcel.ext.xl import XLWriter
>>> from pyexcel_xls import XLWriter
>>> data = OrderedDict() # from collections import OrderedDict
>>> data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]})
>>> data.update({"Sheet 2": [["row 1", "row 2", "row 3"]]})
>>> writer = XLWriter("your_file.xls")
>>> writer.write(data)
>>> writer.close()

Read from an xl file
Read from an xls file
**********************

Here's the sample code::

>>> from pyexcel.ext.xl import XLBook
>>> from pyexcel_xls import XLBook

>>> book = XLBook("your_file.xls")
>>> # book.sheets() returns a dictionary of all sheet content
Expand All @@ -78,12 +78,12 @@ Here's the sample code::
>>> print(json.dumps(book.sheets()))
{"Sheet 1": [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], "Sheet 2": [["row 1", "row 2", "row 3"]]}

Write an xl to memory
Write an xls to memory
**********************

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

>>> from pyexcel.ext.xl import XLWriter
>>> from pyexcel_xls import XLWriter
>>> data = OrderedDict()
>>> data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]})
>>> data.update({"Sheet 2": [[7, 8, 9], [10, 11, 12]]})
Expand All @@ -96,7 +96,7 @@ Here's the sample code to write a dictionary to an xl file::
>>> # object for downloading

Read from an xl from memory
Read from an xls from memory
*****************************

Continue from previous example::
Expand All @@ -114,7 +114,7 @@ As a pyexcel plugin

Import it in your file to enable this plugin::

from pyexcel.ext import xl
from pyexcel.ext import xls

Please note only pyexcel version 0.0.4+ support this.

Expand All @@ -124,7 +124,7 @@ Reading from an xl file
Here is the sample code::

>>> import pyexcel as pe
>>> from pyexcel.ext import xl
>>> from pyexcel.ext import xls
# "example.xls"
>>> sheet = pe.load_book("your_file.xls")
Expand Down
2 changes: 0 additions & 2 deletions pyexcel/__init__.py

This file was deleted.

12 changes: 0 additions & 12 deletions pyexcel/__init__.py~

This file was deleted.

172 changes: 0 additions & 172 deletions pyexcel/xlbook.py~

This file was deleted.

2 changes: 1 addition & 1 deletion pyexcel/ext/xl.py → pyexcel_xls/__init__.py
Expand Up @@ -11,7 +11,7 @@
import datetime
import xlrd
from xlwt import Workbook, XFStyle
from pyexcel.ioext import SheetReader, BookReader, SheetWriter, BookWriter
from pyexcel_io import SheetReader, BookReader, SheetWriter, BookWriter
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
from ordereddict import OrderedDict
else:
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Expand Up @@ -11,18 +11,19 @@

dependencies = [
'xlrd',
'xlwt-future'
'xlwt-future',
'pyexcel-io'
]
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
dependencies.append('ordereddict')

setup(
name='pyexcel-xl',
name='pyexcel-xls',
author="C. W.",
version='0.0.1',
author_email="wangc_2011@hotmail.com",
url="https://github.com/chfw/pyexcel-xl",
description='A wrapper library to read, manipulate and write data in xls, xlsx and xlsm format',
url="https://github.com/chfw/pyexcel-xls",
description='A wrapper library to read, manipulate and write data in xls format. It reads xlsx and xlsm format',
install_requires=dependencies,
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
Expand Down

0 comments on commit fecf468

Please sign in to comment.