Skip to content

Commit 7fea448

Browse files
authored
Merge pull request #113 from pyexcel/dev
0.6.6 - minor update on log
2 parents 39a3658 + 1caf894 commit 7fea448

34 files changed

+68
-48
lines changed

.github/workflows/pythonpackage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python package
1+
name: Unit tests on ubuntu
22

33
on: [push]
44

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: run_tests
1+
name: Run unit tests on Windows and Mac
22

33
on: [push, pull_request]
44

CHANGELOG.rst

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

4+
0.6.6 - 31.1.2022
5+
--------------------------------------------------------------------------------
6+
7+
**updated**
8+
9+
#. `#112 <https://github.com/pyexcel/pyexcel-io/issues/112>`_: Log Empty Row
10+
Warning instead 'print'
11+
412
0.6.5 - 08.10.2021
513
--------------------------------------------------------------------------------
614

CONTRIBUTORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ In alphabetical order:
99
* `John Vandenberg <https://github.com/jayvdb>`_
1010
* `Stephen J. Fuhry <https://github.com/fuhrysteve>`_
1111
* `Stephen Rauch <https://github.com/stephenrauch>`_
12-
* `vinraspa <https://github.com/vinraspa>`_
12+
* `Vincent Raspal <https://github.com/vinraspa>`_
1313
* `Víctor Antonio Hernández Monroy <https://github.com/antherkiv>`_

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2020 by Onni Software Ltd. and its contributors
1+
Copyright (c) 2015-2022 by Onni Software Ltd. and its contributors
22
All rights reserved.
33

44
Redistribution and use in source and binary forms of the software as well

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+
- "`#112`: Log Empty Row Warning instead 'print' "
8+
version: 0.6.6
9+
date: 31.1.2022
410
- changes:
511
- action: updated
612
details:

docs/source/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
# -- Project information -----------------------------------------------------
2424

2525
project = 'pyexcel-io'
26-
copyright = '2015-2020 Onni Software Ltd.'
26+
copyright = '2015-2022 Onni Software Ltd.'
2727
author = 'C.W.'
2828
# The short X.Y version
29-
version = '0.6.5'
29+
version = '0.6.6'
3030
# The full version, including alpha/beta/rc tags
31-
release = '0.6.5'
31+
release = '0.6.6'
3232

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

docs/source/extensions.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Extend pyexcel-io Tutorial
1+
Extend pyexcel-io for other excel or tabular formats
22
================================================================================
33

44
You are welcome to extend pyexcel-io to read and write more tabular formats.
@@ -26,7 +26,7 @@ we can use get_data() to read yaml file out.
2626

2727
**Implement IReader**
2828

29-
First, let's impolement reader interface as below. Three implementations are required:
29+
First, let's implement reader interface:
3030

3131
1. `content_array` attribute, is expected to be a list of `NamedContent`
3232
2. `read_sheet` function, read sheet content by its index.
@@ -41,10 +41,10 @@ First, let's impolement reader interface as below. Three implementations are req
4141
`YourSingleSheet` makes this simple task complex in order to show case its inner
4242
workings. Two abstract functions require implementation:
4343

44-
1. `row_iterator`: should return a row: either content arry or content index as long as
45-
`column_iterator` understands
44+
1. `row_iterator`: should return a row: either content arary or content index as long as
45+
`column_iterator` can use it to return the cell value.
4646

47-
2. `column_iterator`: should return cell values one by one.
47+
2. `column_iterator`: should iterate cell value from the given row.
4848

4949
.. literalinclude:: ../../examples/custom_yaml_reader.py
5050
:language: python
@@ -63,6 +63,8 @@ files on physical disk. "memory" means a file stream. "content" means a string b
6363
:language: python
6464
:lines: 36-41
6565

66+
Usually, this registration code was placed in __init__.py file at the top level of your
67+
extension source tree. You can take a look at any pyexcel plugins for reference.
6668

6769
**Test your reader**
6870

pyexcel-io.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ overrides: "pyexcel.yaml"
22
project: "pyexcel-io"
33
name: pyexcel-io
44
nick_name: io
5-
version: 0.6.5
6-
current_version: 0.6.5
7-
release: 0.6.5
8-
copyright_year: 2015-2020
5+
version: 0.6.6
6+
current_version: 0.6.6
7+
release: 0.6.6
8+
copyright_year: 2015-2022
99
moban_command: false
1010
is_on_conda: true
1111
dependencies:

pyexcel_io/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Uniform interface for reading/writing different excel file formats
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import logging

pyexcel_io/_compact.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Compatibles
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import sys

pyexcel_io/book.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The io interface to file extensions
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import warnings

pyexcel_io/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Constants appeared in pyexcel
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License
99
"""
1010
# flake8: noqa

pyexcel_io/database/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
database data importer and exporter
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
from pyexcel_io.plugins import IOPluginInfoChainV2

pyexcel_io/database/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Common classes shared among database importers and exporters
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010

pyexcel_io/database/exporters/django.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level handler for django import and export
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
from pyexcel_io.plugin_api import IReader

pyexcel_io/database/exporters/sqlalchemy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level handler for database import and export
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
from pyexcel_io.plugin_api import IReader

pyexcel_io/database/importers/django.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level handler for django import and export
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import logging
@@ -31,7 +31,7 @@ def __init__(self, importer, adapter, batch_size=None, bulk_save=True):
3131

3232
def write_row(self, array):
3333
if is_empty_array(array):
34-
print(constants.MESSAGE_EMPTY_ARRAY)
34+
log.warning(constants.MESSAGE_EMPTY_ARRAY)
3535
else:
3636
new_array = swap_empty_string_for_none(array)
3737
if self.mapdict:

pyexcel_io/database/importers/sqlalchemy.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
55
The lower level handler for database import and export
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
10+
import logging
11+
1012
import pyexcel_io.constants as constants
1113
from pyexcel_io.utils import is_empty_array, swap_empty_string_for_none
1214
from pyexcel_io.plugin_api import IWriter, ISheetWriter
1315

16+
LOG = logging.getLogger(__name__)
17+
1418

1519
class PyexcelSQLSkipRowException(Exception):
1620
"""
@@ -35,14 +39,14 @@ def __init__(
3539

3640
def write_row(self, array):
3741
if is_empty_array(array):
38-
print(constants.MESSAGE_EMPTY_ARRAY)
42+
LOG.warning(constants.MESSAGE_EMPTY_ARRAY)
3943
else:
4044
new_array = swap_empty_string_for_none(array)
4145
try:
4246
self._write_row(new_array)
4347
except PyexcelSQLSkipRowException:
44-
print(constants.MESSAGE_IGNORE_ROW)
45-
print(new_array)
48+
LOG.info(constants.MESSAGE_IGNORE_ROW)
49+
LOG.info(new_array)
4650

4751
def _write_row(self, array):
4852
new_array = array

pyexcel_io/database/querysets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level handler for querysets
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import datetime

pyexcel_io/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
all possible exceptions
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010

pyexcel_io/io.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The io interface to file extensions
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import os

pyexcel_io/manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Control file streams
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
from pyexcel_io._compact import BytesIO, StringIO

pyexcel_io/plugins.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
factory for getting readers and writers
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import pyexcel_io.utils as ioutils

pyexcel_io/readers/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
file readers
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
from pyexcel_io.plugins import IOPluginInfoChainV2

pyexcel_io/readers/csv_sheet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
csv file reader
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import csv

pyexcel_io/readers/csvz.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level csvz file format handler.
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import zipfile

pyexcel_io/service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
provide service code to downstream projects
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import re

pyexcel_io/sheet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The io interface to file extensions
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import pyexcel_io.constants as constants

pyexcel_io/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
utility functions
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import pyexcel_io.constants as constants

pyexcel_io/writers/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
file writers
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
from pyexcel_io.plugins import IOPluginInfoChainV2

pyexcel_io/writers/csv_sheet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level csv file format writer
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import csv

pyexcel_io/writers/csvz_sheet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The lower level csvz file format handler.
66
7-
:copyright: (c) 2014-2020 by Onni Software Ltd.
7+
:copyright: (c) 2014-2022 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import csv

0 commit comments

Comments
 (0)