Skip to content

Commit 1136d9b

Browse files
authored
Merge pull request #106 from pyexcel/dev
Release 0.6.4
2 parents 9d70e97 + 98e0e76 commit 1136d9b

File tree

13 files changed

+184
-130
lines changed

13 files changed

+184
-130
lines changed

CHANGELOG.rst

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change log
22
================================================================================
33

4+
0.6.4 - 31.10.2020
5+
--------------------------------------------------------------------------------
6+
7+
**updated**
8+
9+
#. `#102 <https://github.com/pyexcel/pyexcel-io/issues/102>`_: skip columns from
10+
imported excel sheet.
11+
412
0.6.3 - 12.10.2020
513
--------------------------------------------------------------------------------
614

README.rst

+36-29
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pyexcel-io - Let you focus on data, instead of file formats
55
.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png
66
:target: https://www.patreon.com/chfw
77

8-
.. image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
8+
.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel-mobans/master/images/awesome-badge.svg
99
:target: https://awesome-python.com/#specific-formats-processing
1010

1111
.. image:: https://travis-ci.org/pyexcel/pyexcel-io.svg?branch=master
@@ -21,7 +21,7 @@ pyexcel-io - Let you focus on data, instead of file formats
2121
:target: https://anaconda.org/conda-forge/pyexcel-io
2222

2323
.. image:: https://pepy.tech/badge/pyexcel-io/month
24-
:target: https://pepy.tech/project/pyexcel-io/month
24+
:target: https://pepy.tech/project/pyexcel-io
2525

2626
.. image:: https://anaconda.org/conda-forge/pyexcel-io/badges/downloads.svg
2727
:target: https://anaconda.org/conda-forge/pyexcel-io
@@ -60,6 +60,8 @@ Known constraints
6060

6161
Fonts, colors and charts are not supported.
6262

63+
Nor to read password protected xls, xlsx and ods files.
64+
6365
Introduction
6466
================================================================================
6567

@@ -74,44 +76,47 @@ sqlalchemy supported databases. Its supported file formats are extended to cover
7476

7577
.. table:: A list of file formats supported by external plugins
7678

77-
======================== ======================= ================= ==================
78-
Package name Supported file formats Dependencies Python versions
79-
======================== ======================= ================= ==================
80-
`pyexcel-io`_ >=v0.6.0 csv, csvz [#f1]_, tsv, 3.6+
81-
tsvz [#f2]_
82-
`pyexcel-io`_ <=0.5.20 same as above 2.6, 2.7, 3.3,
83-
3.4, 3.5, 3.6
84-
pypy
85-
`pyexcel-xls`_ xls, xlsx(read only), `xlrd`_, same as above
79+
======================== ======================= =================
80+
Package name Supported file formats Dependencies
81+
======================== ======================= =================
82+
`pyexcel-io`_ csv, csvz [#f1]_, tsv,
83+
tsvz [#f2]_
84+
`pyexcel-xls`_ xls, xlsx(read only), `xlrd`_,
8685
xlsm(read only) `xlwt`_
87-
`pyexcel-xlsx`_ xlsx `openpyxl`_ same as above
88-
`pyexcel-ods3`_ ods `pyexcel-ezodf`_, 2.6, 2.7, 3.3, 3.4
89-
lxml 3.5, 3.6
90-
`pyexcel-ods`_ ods `odfpy`_ same as above
91-
======================== ======================= ================= ==================
86+
`pyexcel-xlsx`_ xlsx `openpyxl`_
87+
`pyexcel-ods3`_ ods `pyexcel-ezodf`_,
88+
lxml
89+
`pyexcel-ods`_ ods `odfpy`_
90+
======================== ======================= =================
9291

9392
.. table:: Dedicated file reader and writers
9493

95-
======================== ======================= ================= ==================
96-
Package name Supported file formats Dependencies Python versions
97-
======================== ======================= ================= ==================
98-
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_ Python 2 and 3
99-
`pyexcel-xlsxr`_ xlsx(read only) lxml same as above
100-
`pyexcel-xlsbr`_ xlsx(read only) pyxlsb same as above
101-
`pyexcel-odsr`_ read only for ods, fods lxml same as above
102-
`pyexcel-odsw`_ write only for ods loxun same as above
103-
`pyexcel-htmlr`_ html(read only) lxml,html5lib same as above
104-
`pyexcel-pdfr`_ pdf(read only) pdftables Python 2 only.
105-
======================== ======================= ================= ==================
94+
======================== ======================= =================
95+
Package name Supported file formats Dependencies
96+
======================== ======================= =================
97+
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_
98+
`pyexcel-libxlsxw`_ xlsx(write only) `libxlsxwriter`_
99+
`pyexcel-xlsxr`_ xlsx(read only) lxml
100+
`pyexcel-xlsbr`_ xlsb(read only) pyxlsb
101+
`pyexcel-odsr`_ read only for ods, fods lxml
102+
`pyexcel-odsw`_ write only for ods loxun
103+
`pyexcel-htmlr`_ html(read only) lxml,html5lib
104+
`pyexcel-pdfr`_ pdf(read only) camelot
105+
======================== ======================= =================
106106

107107

108108
Plugin shopping guide
109109
------------------------
110110

111+
Since 2020, all pyexcel-io plugins have dropped the support for python version
112+
lower than 3.6. If you want to use any python verions, please use pyexcel-io
113+
and its plugins version lower than 0.6.0.
114+
115+
111116
Except csv files, xls, xlsx and ods files are a zip of a folder containing a lot of
112-
xml files
117+
xml files
113118

114-
The dedicated readers for excel files can stream read
119+
The dedicated readers for excel files can stream read
115120

116121

117122
In order to manage the list of plugins installed, you need to use pip to add or remove
@@ -133,6 +138,7 @@ You need to append get_array(..., library='pyexcel-odsr').
133138
.. _pyexcel-pdfr: https://github.com/pyexcel/pyexcel-pdfr
134139

135140
.. _pyexcel-xlsxw: https://github.com/pyexcel/pyexcel-xlsxw
141+
.. _pyexcel-libxlsxw: https://github.com/pyexcel/pyexcel-libxlsxw
136142
.. _pyexcel-xlsxr: https://github.com/pyexcel/pyexcel-xlsxr
137143
.. _pyexcel-xlsbr: https://github.com/pyexcel/pyexcel-xlsbr
138144
.. _pyexcel-htmlr: https://github.com/pyexcel/pyexcel-htmlr
@@ -143,6 +149,7 @@ You need to append get_array(..., library='pyexcel-odsr').
143149
.. _XlsxWriter: https://github.com/jmcnamara/XlsxWriter
144150
.. _pyexcel-ezodf: https://github.com/pyexcel/pyexcel-ezodf
145151
.. _odfpy: https://github.com/eea/odfpy
152+
.. _libxlsxwriter: http://libxlsxwriter.github.io/getting_started.html
146153

147154

148155
.. rubric:: Footnotes

changelog.yml

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: pyexcel-io
22
organisation: pyexcel
33
releases:
4+
- changes:
5+
- action: updated
6+
details:
7+
- "`#102`: skip columns from imported excel sheet."
8+
version: 0.6.4
9+
date: 31.10.2020
410
- changes:
511
- action: fixed
612
details:

docs/source/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424

2525
project = 'pyexcel-io'
2626
copyright = '2015-2020 Onni Software Ltd.'
27-
author = 'chfw'
27+
author = 'C.W.'
2828
# The short X.Y version
29-
version = '0.6.3'
29+
version = '0.6.4'
3030
# The full version, including alpha/beta/rc tags
31-
release = '0.6.3'
31+
release = '0.6.4'
3232

3333
# -- General configuration ---------------------------------------------------
3434

docs/source/index.rst

+33-28
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
`pyexcel-io` - Let you focus on data, instead of file formats
77
================================================================================
88

9-
:Author: chfw
9+
:Author: C.W.
1010
:Source code: http://github.com/pyexcel/pyexcel-io.git
1111
:Issues: http://github.com/pyexcel/pyexcel-io/issues
1212
:License: New BSD License
@@ -64,44 +64,47 @@ For individual excel file formats, please install them as you wish:
6464

6565
.. table:: A list of file formats supported by external plugins
6666

67-
======================== ======================= ================= ==================
68-
Package name Supported file formats Dependencies Python versions
69-
======================== ======================= ================= ==================
70-
`pyexcel-io`_ >=v0.6.0 csv, csvz [#f1]_, tsv, 3.6+
71-
tsvz [#f2]_
72-
`pyexcel-io`_ <=0.5.20 same as above 2.6, 2.7, 3.3,
73-
3.4, 3.5, 3.6
74-
pypy
75-
`pyexcel-xls`_ xls, xlsx(read only), `xlrd`_, same as above
67+
======================== ======================= =================
68+
Package name Supported file formats Dependencies
69+
======================== ======================= =================
70+
`pyexcel-io`_ csv, csvz [#f1]_, tsv,
71+
tsvz [#f2]_
72+
`pyexcel-xls`_ xls, xlsx(read only), `xlrd`_,
7673
xlsm(read only) `xlwt`_
77-
`pyexcel-xlsx`_ xlsx `openpyxl`_ same as above
78-
`pyexcel-ods3`_ ods `pyexcel-ezodf`_, 2.6, 2.7, 3.3, 3.4
79-
lxml 3.5, 3.6
80-
`pyexcel-ods`_ ods `odfpy`_ same as above
81-
======================== ======================= ================= ==================
74+
`pyexcel-xlsx`_ xlsx `openpyxl`_
75+
`pyexcel-ods3`_ ods `pyexcel-ezodf`_,
76+
lxml
77+
`pyexcel-ods`_ ods `odfpy`_
78+
======================== ======================= =================
8279

8380
.. table:: Dedicated file reader and writers
8481

85-
======================== ======================= ================= ==================
86-
Package name Supported file formats Dependencies Python versions
87-
======================== ======================= ================= ==================
88-
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_ Python 2 and 3
89-
`pyexcel-xlsxr`_ xlsx(read only) lxml same as above
90-
`pyexcel-xlsbr`_ xlsx(read only) pyxlsb same as above
91-
`pyexcel-odsr`_ read only for ods, fods lxml same as above
92-
`pyexcel-odsw`_ write only for ods loxun same as above
93-
`pyexcel-htmlr`_ html(read only) lxml,html5lib same as above
94-
`pyexcel-pdfr`_ pdf(read only) pdftables Python 2 only.
95-
======================== ======================= ================= ==================
82+
======================== ======================= =================
83+
Package name Supported file formats Dependencies
84+
======================== ======================= =================
85+
`pyexcel-xlsxw`_ xlsx(write only) `XlsxWriter`_
86+
`pyexcel-libxlsxw`_ xlsx(write only) `libxlsxwriter`_
87+
`pyexcel-xlsxr`_ xlsx(read only) lxml
88+
`pyexcel-xlsbr`_ xlsb(read only) pyxlsb
89+
`pyexcel-odsr`_ read only for ods, fods lxml
90+
`pyexcel-odsw`_ write only for ods loxun
91+
`pyexcel-htmlr`_ html(read only) lxml,html5lib
92+
`pyexcel-pdfr`_ pdf(read only) camelot
93+
======================== ======================= =================
9694

9795

9896
Plugin shopping guide
9997
------------------------
10098

99+
Since 2020, all pyexcel-io plugins have dropped the support for python version
100+
lower than 3.6. If you want to use any python verions, please use pyexcel-io
101+
and its plugins version lower than 0.6.0.
102+
103+
101104
Except csv files, xls, xlsx and ods files are a zip of a folder containing a lot of
102-
xml files
105+
xml files
103106

104-
The dedicated readers for excel files can stream read
107+
The dedicated readers for excel files can stream read
105108

106109

107110
In order to manage the list of plugins installed, you need to use pip to add or remove
@@ -123,6 +126,7 @@ You need to append get_array(..., library='pyexcel-odsr').
123126
.. _pyexcel-pdfr: https://github.com/pyexcel/pyexcel-pdfr
124127

125128
.. _pyexcel-xlsxw: https://github.com/pyexcel/pyexcel-xlsxw
129+
.. _pyexcel-libxlsxw: https://github.com/pyexcel/pyexcel-libxlsxw
126130
.. _pyexcel-xlsxr: https://github.com/pyexcel/pyexcel-xlsxr
127131
.. _pyexcel-xlsbr: https://github.com/pyexcel/pyexcel-xlsbr
128132
.. _pyexcel-htmlr: https://github.com/pyexcel/pyexcel-htmlr
@@ -133,6 +137,7 @@ You need to append get_array(..., library='pyexcel-odsr').
133137
.. _XlsxWriter: https://github.com/jmcnamara/XlsxWriter
134138
.. _pyexcel-ezodf: https://github.com/pyexcel/pyexcel-ezodf
135139
.. _odfpy: https://github.com/eea/odfpy
140+
.. _libxlsxwriter: http://libxlsxwriter.github.io/getting_started.html
136141

137142

138143
.. rubric:: Footnotes

lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pip install flake8
2-
flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long . && python setup.py checkdocs
2+
flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long . && python setup.py checkdocs

pyexcel-io.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ overrides: "pyexcel.yaml"
22
project: "pyexcel-io"
33
name: pyexcel-io
44
nick_name: io
5-
version: 0.6.3
6-
current_version: 0.6.3
7-
release: 0.6.3
5+
version: 0.6.4
6+
current_version: 0.6.4
7+
release: 0.6.4
88
copyright_year: 2015-2020
99
moban_command: false
1010
is_on_conda: true

pyexcel_io/database/common.py

+32-27
Original file line numberDiff line numberDiff line change
@@ -38,61 +38,66 @@ def __init__(self):
3838

3939
def __init__(self, model):
4040
DjangoModelExportAdapter.__init__(self, model)
41-
self.__column_names = self.InOutParameter()
42-
self.__column_name_mapping_dict = self.InOutParameter()
43-
self.__row_initializer = self.InOutParameter()
41+
self._column_names = self.InOutParameter()
42+
self._column_name_mapping_dict = self.InOutParameter()
43+
self._row_initializer = self.InOutParameter()
4444
self._process_parameters()
4545

4646
@property
4747
def row_initializer(self):
4848
""" contructor for a database table entry """
49-
return self.__row_initializer.output
49+
return self._row_initializer.output
5050

5151
@property
5252
def column_names(self):
5353
""" the desginated database column names """
54-
return self.__column_names.output
54+
return self._column_names.output
5555

5656
@property
5757
def column_name_mapping_dict(self):
5858
""" if not the same, a mapping dictionary is looked up"""
59-
return self.__column_name_mapping_dict.output
59+
return self._column_name_mapping_dict.output
6060

6161
@row_initializer.setter
6262
def row_initializer(self, a_function):
6363
""" set the contructor """
64-
self.__row_initializer.input = a_function
64+
self._row_initializer.input = a_function
6565
self._process_parameters()
6666

6767
@column_names.setter
6868
def column_names(self, column_names):
6969
""" set the column names """
70-
self.__column_names.input = column_names
70+
self._column_names.input = column_names
7171
self._process_parameters()
7272

7373
@column_name_mapping_dict.setter
7474
def column_name_mapping_dict(self, mapping_dict):
7575
""" set the mapping dict """
76-
self.__column_name_mapping_dict.input = mapping_dict
76+
self._column_name_mapping_dict.input = mapping_dict
7777
self._process_parameters()
7878

7979
def _process_parameters(self):
80-
if self.__row_initializer.input is None:
81-
self.__row_initializer.output = None
80+
if self._row_initializer.input is None:
81+
self._row_initializer.output = None
8282
else:
83-
self.__row_initializer.output = self.__row_initializer.input
84-
if isinstance(self.__column_name_mapping_dict.input, list):
85-
self.__column_names.output = self.__column_name_mapping_dict.input
86-
self.__column_name_mapping_dict.output = None
87-
elif isinstance(self.__column_name_mapping_dict.input, dict):
88-
if self.__column_names.input:
89-
self.__column_names.output = [
90-
self.__column_name_mapping_dict.input[name]
91-
for name in self.__column_names.input
92-
]
93-
self.__column_name_mapping_dict.output = None
94-
if self.__column_names.output is None:
95-
self.__column_names.output = self.__column_names.input
83+
self._row_initializer.output = self._row_initializer.input
84+
if isinstance(self._column_name_mapping_dict.input, list):
85+
self._column_names.output = self._column_name_mapping_dict.input
86+
self._column_name_mapping_dict.output = None
87+
elif isinstance(self._column_name_mapping_dict.input, dict):
88+
89+
if self._column_names.input:
90+
self._column_names.output = []
91+
indices = []
92+
for index, name in enumerate(self._column_names.input):
93+
if name in self._column_name_mapping_dict.input:
94+
self._column_names.output.append(
95+
self._column_name_mapping_dict.input[name]
96+
)
97+
indices.append(index)
98+
self._column_name_mapping_dict.output = indices
99+
if self._column_names.output is None:
100+
self._column_names.output = self._column_names.input
96101

97102

98103
class DjangoModelExporter(object):
@@ -110,15 +115,15 @@ class DjangoModelImporter(object):
110115
""" public interface for django model import """
111116

112117
def __init__(self):
113-
self.__adapters = {}
118+
self._adapters = {}
114119

115120
def append(self, import_adapter):
116121
""" store model parameter for more than one model """
117-
self.__adapters[import_adapter.get_name()] = import_adapter
122+
self._adapters[import_adapter.get_name()] = import_adapter
118123

119124
def get(self, name):
120125
""" get a parameter out """
121-
return self.__adapters.get(name, None)
126+
return self._adapters.get(name, None)
122127

123128

124129
class SQLTableExportAdapter(DjangoModelExportAdapter):

0 commit comments

Comments
 (0)