10000 :handshake: take latest code from setupmobans, carrying LICENSE file,… · pyexcel-webwares/Flask-Excel@3f60852 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f60852

Browse files
committed
🤝 take latest code from setupmobans, carrying LICENSE file, pyexcel/pyexcel#103, update docs pyexcel/pyexcel#104
1 parent 4cb9537 commit 3f60852

File tree

6 files changed

+133
-57
lines changed

6 files changed

+133
-57
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include README.rst
2+
include LICENSE
23
include CHANGELOG.rst

README.rst

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ product, please `support me on patreon <https://www.patreon.com/bePatron?u=55376
2525
maintain the project and develop it further.
2626

2727
If you are an individual, you are welcome to support me too on patreon and for however long
28-
you feel like to. As a patreon, you will receive
28+
you feel like. As a patreon, you will receive
2929
`early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
3030

3131
With your financial support, I will be able to invest
@@ -56,15 +56,16 @@ well as on file system. This library can turn the excel data into a list of list
5656
a list of records(dictionaries), dictionaries of lists. And vice versa. Hence it
5757
lets you focus on data in Flask based web development, instead of file formats.
5858

59-
The idea originated from the common usability problem when developing an excel file
60-
driven web applications for non-technical office workers: such as office assistant,
61-
human resource administrator. The fact is that not all people know the
62-
difference among various excel formats: csv, xls, xlsx. Instead of training those people
59+
The idea originated from the common usability problem: when an excel file
60+
driven web application is delivered for non-developer users (ie: team assistant,
61+
human resource administrator etc). The fact is that not everyone knows (or cares) about the
62+
differences between various excel formats: csv, xls, xlsx are all the same to them. Instead of training those users
6363
about file formats, this library helps web developers to handle most of the excel file
64-
formats by providing a common programming interface. To add a specific excel file format
65-
to you application, all you need is to install an extra pyexcel plugin. No code change
66-
to your application. Looking at the community, this library and its associated ones try
67-
to become a small and easy to install alternative to Pandas.
64+
formats by providing a common programming interface. To add a specific excel file format type
65+
to you application, all you need is to install an extra pyexcel plugin. Hence no code changes
66+
to your application and no issues with excel file formats any more. Looking at the
67+
community, this library and its associated ones try to become a small and easy to
68+
install alternative to Pandas.
6869

6970

7071
The highlighted features are:
@@ -90,26 +91,22 @@ The highlighted features are:
9091
`pyexcel-xls`_ xls, xlsx(read only), `xlrd`_, same as above
9192
xlsm(read only) `xlwt`_
9293
`pyexcel-xlsx`_ xlsx `openpyxl`_ same as above
93-
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_ same as above
9494
`pyexcel-ods3`_ ods `pyexcel-ezodf`_, 2.6, 2.7, 3.3, 3.4
9595
lxml 3.5, 3.6
9696
`pyexcel-ods`_ ods `odfpy`_ same as above
97+
======================== ======================= ================= ==================
98+
99+
.. table:: Dedicated file reader and writers
100+
101+
======================== ======================= ================= ==================
102+
Package name Supported file formats Dependencies Python versions
103+
======================== ======================= ================= ==================
104+
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_ Python 2 and 3
97105
`pyexcel-odsr`_ read only for ods, fods lxml same as above
98106
`pyexcel-htmlr`_ html(read only) lxml,html5lib same as above
99-
`pyexcel-text`_ write only:rst, `tabulate`_ 2.6, 2.7, 3.3, 3.4
100-
mediawiki, html, 3.5, 3.6, pypy
101-
latex, grid, pipe,
102-
orgtbl, plain simple
103-
read only: ndjson
104-
r/w: json
105-
`pyexcel-handsontable`_ handsontable in html `handsontable`_ same as above
106-
`pyexcel-pygal`_ svg chart `pygal`_ 2.7, 3.3, 3.4, 3.5
107-
3.6, pypy
108-
`pyexcel-sortable`_ sortable table in html `csvtotable`_ same as above
109-
`pyexcel-gantt`_ gantt chart in html `frappe-gantt`_ except pypy, same
110-
as above
111107
======================== ======================= ================= ==================
112108

109+
113110
.. _pyexcel-io: https://github.com/pyexcel/pyexcel-io
114111
.. _pyexcel-xls: https://github.com/pyexcel/pyexcel-xls
115112
.. _pyexcel-xlsx: https://github.com/pyexcel/pyexcel-xlsx
@@ -126,6 +123,25 @@ The highlighted features are:
126123
.. _pyexcel-ezodf: https://github.com/pyexcel/pyexcel-ezodf
127124
.. _odfpy: https://github.com/eea/odfpy
128125

126+
.. table:: Other data renderers
127+
128+
======================== ======================= ================= ==================
129+
Package name Supported file formats Dependencies Python versions
130+
======================== ======================= ================= ==================
131+
`pyexcel-text`_ write only:rst, `tabulate`_ 2.6, 2.7, 3.3, 3.4
132+
mediawiki, html, 3.5, 3.6, pypy
133+
latex, grid, pipe,
134+
orgtbl, plain simple
135+
read only: ndjson
136+
r/w: json
137+
`pyexcel-handsontable`_ handsontable in html `handsontable`_ same as above
138+
`pyexcel-pygal`_ svg chart `pygal`_ 2.7, 3.3, 3.4, 3.5
139+
3.6, pypy
140+
`pyexcel-sortable`_ sortable table in html `csvtotable`_ same as above
141+
`pyexcel-gantt`_ gantt chart in html `frappe-gantt`_ except pypy, same
142+
as above
143+
======================== ======================= ================= ==================
144+
129145
.. _pyexcel-text: https://github.com/pyexcel/pyexcel-text
130146
.. _tabulate: https://bitbucket.org/astanin/python-tabulate
131147
.. _pyexcel-handsontable: https://github.com/pyexcel/pyexcel-handsontable
@@ -179,7 +195,8 @@ Tested Flask Versions
179195

180196
Installation
181197
================================================================================
182-
You can install it via pip:
198+
199+
You can install Flask-Excel via pip:
183200

184201
.. code-block:: bash
185202

docs/source/index.rst

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ well as on file system. This library can turn the excel data into a list of list
3030
a list of records(dictionaries), dictionaries of lists. And vice versa. Hence it
3131
lets you focus on data in Flask based web development, instead of file formats.
3232

33-
The idea originated from the common usability problem when developing an excel file
34-
driven web applications for non-technical office workers: such as office assistant,
35-
human resource administrator. The fact is that not all people know the
36-
difference among various excel formats: csv, xls, xlsx. Instead of training those people
33+
The idea originated from the common usability problem: when an excel file
34+
driven web application is delivered for non-developer users (ie: team assistant,
35+
human resource administrator etc). The fact is that not everyone knows (or cares) about the
36+
differences between various excel formats: csv, xls, xlsx are all the same to them. Instead of training those users
3737
about file formats, this library helps web developers to handle most of the excel file
38-
formats by providing a common programming interface. To add a specific excel file format
39-
to you application, all you need is to install an extra pyexcel plugin. No code change
40-
to your application. Looking at the community, this library and its associated ones try
41-
to become a small and easy to install alternative to Pandas.
38+
formats by providing a common programming interface. To add a specific excel file format type
39+
to you application, all you need is to install an extra pyexcel plugin. Hence no code changes
40+
to your application and no issues with excel file formats any more. Looking at the
41+
community, this library and its associated ones try to become a small and easy to
42+
install alternative to Pandas.
4243

4344

4445
The highlighted features are:
@@ -64,26 +65,22 @@ The highlighted features are:
6465
`pyexcel-xls`_ xls, xlsx(read only), `xlrd`_, same as above
6566
xlsm(read only) `xlwt`_
6667
`pyexcel-xlsx`_ xlsx `openpyxl`_ same as above
67-
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_ same as above
6868
`pyexcel-ods3`_ ods `pyexcel-ezodf`_, 2.6, 2.7, 3.3, 3.4
6969
lxml 3.5, 3.6
7070
`pyexcel-ods`_ ods `odfpy`_ same as above
71+
======================== ======================= ================= ==================
72+
73+
.. table:: Dedicated file reader and writers
74+
75+
======================== ======================= ================= ==================
76+
Package name Supported file formats Dependencies Python versions
77+
======================== ======================= ================= ==================
78+
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_ Python 2 and 3
7179
`pyexcel-odsr`_ read only for ods, fods lxml same as above
7280
`pyexcel-htmlr`_ html(read only) lxml,html5lib same as above
73-
`pyexcel-text`_ write only:rst, `tabulate`_ 2.6, 2.7, 3.3, 3.4
74-
mediawiki, html, 3.5, 3.6, pypy
75-
latex, grid, pipe,
76-
orgtbl, plain simple
77-
read only: ndjson
78-
r/w: json
79-
`pyexcel-handsontable`_ handsontable in html `handsontable`_ same as above
80-
`pyexcel-pygal`_ svg chart `pygal`_ 2.7, 3.3, 3.4, 3.5
81-
3.6, pypy
82-
`pyexcel-sortable`_ sortable table in html `csvtotable`_ same as above
83-
`pyexcel-gantt`_ gantt chart in html `frappe-gantt`_ except pypy, same
84-
as above
8581
======================== ======================= ================= ==================
8682

83+
8784
.. _pyexcel-io: https://github.com/pyexcel/pyexcel-io
8885
.. _pyexcel-xls: https://github.com/pyexcel/pyexcel-xls
8986
.. _pyexcel-xlsx: https://github.com/pyexcel/pyexcel-xlsx
@@ -100,6 +97,25 @@ The highlighted features are:
10097
.. _pyexcel-ezodf: https://github.com/pyexcel/pyexcel-ezodf
10198
.. _odfpy: https://github.com/eea/odfpy
10299

100+
.. table:: Other data renderers
101+
102+
======================== ======================= ================= ==================
103+
Package name Supported file formats Dependencies Python versions
104+
======================== ======================= ================= ==================
105+
`pyexcel-text`_ write only:rst, `tabulate`_ 2.6, 2.7, 3.3, 3.4
106+
mediawiki, html, 3.5, 3.6, pypy
107+
latex, grid, pipe,
108+
orgtbl, plain simple
109+
read only: ndjson
110+
r/w: json
111+
`pyexcel-handsontable`_ handsontable in html `handsontable`_ same as above
112+
`pyexcel-pygal`_ svg chart `pygal`_ 2.7, 3.3, 3.4, 3.5
113+
3.6, pypy
114+
`pyexcel-sortable`_ sortable table in html `csvtotable`_ same as above
115+
`pyexcel-gantt`_ gantt chart in html `frappe-gantt`_ except pypy, same
116+
as above
117+
======================== ======================= ================= ==================
118+
103119
.. _pyexcel-text: https://github.com/pyexcel/pyexcel-text
104120
.. _tabulate: https://bitbucket.org/astanin/python-tabulate
105121
.. _pyexcel-handsontable: https://github.com/pyexcel/pyexcel-handsontable
@@ -139,7 +155,8 @@ and export from SQL databases, information analysis and persistence. It uses
139155
Installation
140156
-------------------
141157

142-
You can install it via pip:
158+
159+
You can install Flask-Excel via pip:
143160

144161
.. code-block:: bash
145162
@@ -215,7 +232,7 @@ product, please `support me on patreon <https://www.patreon.com/bePatron?u=55376
215232
maintain the project and develop it further.
216233

217234
If you are an individual, you are welcome to support me too on patreon and for however long
218-
you feel like to. As a patreon, you will receive
235+
you feel like. As a patreon, you will receive
219236
`early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
220237

221238
With your financial support, I will be able to invest
@@ -297,7 +314,8 @@ And it responds with
297314

298315
.. image:: _static/handson-view.png
299316

300-
This result is rendered via pyexcel-handsontable. All you needed is to put 'handsontable.html' as file type:
317+
This result is rendered via `pyexcel-handsontable <https://github.com/pyexcel/pyexcel-handsontable>`_.
318+
All you needed is to put 'handsontable.html' as file type:
301319

302320
.. literalinclude:: ../../examples/database_example.py
303321
:lines: 115-119

setup.py

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
try:
2-
from setuptools import setup, find_packages
3-
except ImportError:
4-
from ez_setup import use_setuptools
5-
use_setuptools()
6-
from setuptools import setup, find_packages
1+
# Template by setupmobans
2+
import os
3+
import sys
4+
import codecs
5+
from shutil import rmtree
6+
from setuptools import setup, find_packages, Command
77

88
NAME = 'Flask-Excel'
99
AUTHOR = 'C.W.'
@@ -68,6 +68,42 @@
6868
'xlsx': ['pyexcel-xlsx>=0.4.0'],
6969
'ods': ['pyexcel-ods3>=0.4.0'],
7070
}
71+
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format(
72+
sys.executable)
73+
GS_COMMAND = ('gs Flask-Excel v0.0.7 ' +
74+
"Find 0.0.7 in changelog for more details")
75+
here = os.path.abspath(os.path.dirname(__file__))
76+
77+
78+
class PublishCommand(Command):
79+
"""Support setup.py upload."""
80+
81+
description = 'Build and publish the package on github and pypi'
82+
user_options = []
83+
84+
@staticmethod
85+
def status(s):
86+
"""Prints things in bold."""
87+
print('\033[1m{0}\033[0m'.format(s))
88+
89+
def initialize_options(self):
90+
pass
91+
92+
def finalize_options(self):
93+
pass
94+
95+
def run(self):
96+
try:
97+
self.status('Removing previous builds...')
98+
rmtree(os.path.join(here, 'dist'))
99+
except OSError:
100+
pass
101+
102+
self.status('Building Source and Wheel (universal) distribution...')
103+
if os.system(GS_COMMAND) == 0:
104+
os.system(PUBLISH_COMMAND)
105+
106+
sys.exit()
71107

72108

73109
def read_files(*files):
@@ -81,7 +117,7 @@ def read_files(*files):
81117

82118
def read(afile):
83119
"""Read a file into setup"""
84-
with open(afile, 'r') as opened_file:
120+
with codecs.open(afile, 'r', 'utf-8') as opened_file:
85121
content = filter_out_test_code(opened_file)
86122
content = "".join(list(content))
87123
return content
@@ -129,5 +165,9 @@ def filter_out_test_code(file_handle):
129165
packages=PACKAGES,
130166
include_package_data=True,
131167
zip_safe=False,
132-
classifiers=CLASSIFIERS
168+
classifiers=CLASSIFIERS,
169+
setup_requires=['gease'],
170+
cmdclass={
171+
'publish': PublishCommand,
172+
}
133173
)

test.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pip freeze
2-
nosetests --with-cov --cover-package flask_excel --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source flask_excel && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long
2+
nosetests --with-coverage --cover-package flask_excel --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source flask_excel && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pip freeze
2-
nosetests --with-cov --cover-package flask_excel --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source flask_excel && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long
2+
nosetests --with-coverage --cover-package flask_excel --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source flask_excel && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long

0 commit comments

Comments
 (0)
0