diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index a7a148a..e19f742 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,4 +1,4 @@ -name: Python package +name: Unit tests on ubuntu on: [push] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 810f878..801d2cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: run_tests +name: Run unit tests on Windows and Mac on: [push, pull_request] diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8f13c04..5cd5f17 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Change log ================================================================================ +0.6.6 - 31.1.2022 +-------------------------------------------------------------------------------- + +**updated** + +#. `#112 `_: Log Empty Row + Warning instead 'print' + 0.6.5 - 08.10.2021 -------------------------------------------------------------------------------- diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 5a6c33d..45bb32d 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -9,5 +9,5 @@ In alphabetical order: * `John Vandenberg `_ * `Stephen J. Fuhry `_ * `Stephen Rauch `_ -* `vinraspa `_ +* `Vincent Raspal `_ * `Víctor Antonio Hernández Monroy `_ diff --git a/LICENSE b/LICENSE index 747c8b4..8bb697c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2020 by Onni Software Ltd. and its contributors +Copyright (c) 2015-2022 by Onni Software Ltd. and its contributors All rights reserved. Redistribution and use in source and binary forms of the software as well diff --git a/changelog.yml b/changelog.yml index 6a2482d..e9244a9 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,6 +1,12 @@ name: pyexcel-io organisation: pyexcel releases: +- changes: + - action: updated + details: + - "`#112`: Log Empty Row Warning instead 'print' " + version: 0.6.6 + date: 31.1.2022 - changes: - action: updated details: diff --git a/docs/source/conf.py b/docs/source/conf.py index f4d2ba0..7d8e0cc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,12 +23,12 @@ # -- Project information ----------------------------------------------------- project = 'pyexcel-io' -copyright = '2015-2020 Onni Software Ltd.' +copyright = '2015-2022 Onni Software Ltd.' author = 'C.W.' # The short X.Y version -version = '0.6.5' +version = '0.6.6' # The full version, including alpha/beta/rc tags -release = '0.6.5' +release = '0.6.6' # -- General configuration --------------------------------------------------- diff --git a/docs/source/extensions.rst b/docs/source/extensions.rst index d3d0ed3..f436227 100644 --- a/docs/source/extensions.rst +++ b/docs/source/extensions.rst @@ -1,4 +1,4 @@ -Extend pyexcel-io Tutorial +Extend pyexcel-io for other excel or tabular formats ================================================================================ 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. **Implement IReader** -First, let's impolement reader interface as below. Three implementations are required: +First, let's implement reader interface: 1. `content_array` attribute, is expected to be a list of `NamedContent` 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 `YourSingleSheet` makes this simple task complex in order to show case its inner workings. Two abstract functions require implementation: -1. `row_iterator`: should return a row: either content arry or content index as long as - `column_iterator` understands +1. `row_iterator`: should return a row: either content arary or content index as long as + `column_iterator` can use it to return the cell value. -2. `column_iterator`: should return cell values one by one. +2. `column_iterator`: should iterate cell value from the given row. .. literalinclude:: ../../examples/custom_yaml_reader.py :language: python @@ -63,6 +63,8 @@ files on physical disk. "memory" means a file stream. "content" means a string b :language: python :lines: 36-41 +Usually, this registration code was placed in __init__.py file at the top level of your +extension source tree. You can take a look at any pyexcel plugins for reference. **Test your reader** diff --git a/pyexcel-io.yml b/pyexcel-io.yml index 24df243..7dad5e1 100644 --- a/pyexcel-io.yml +++ b/pyexcel-io.yml @@ -2,10 +2,10 @@ overrides: "pyexcel.yaml" project: "pyexcel-io" name: pyexcel-io nick_name: io -version: 0.6.5 -current_version: 0.6.5 -release: 0.6.5 -copyright_year: 2015-2020 +version: 0.6.6 +current_version: 0.6.6 +release: 0.6.6 +copyright_year: 2015-2022 moban_command: false is_on_conda: true dependencies: diff --git a/pyexcel_io/__init__.py b/pyexcel_io/__init__.py index 0e836b2..f215e48 100644 --- a/pyexcel_io/__init__.py +++ b/pyexcel_io/__init__.py @@ -4,7 +4,7 @@ Uniform interface for reading/writing different excel file formats - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import logging diff --git a/pyexcel_io/_compact.py b/pyexcel_io/_compact.py index dd75146..e9827ba 100644 --- a/pyexcel_io/_compact.py +++ b/pyexcel_io/_compact.py @@ -4,7 +4,7 @@ Compatibles - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import sys diff --git a/pyexcel_io/book.py b/pyexcel_io/book.py index 7f0baa1..1948270 100644 --- a/pyexcel_io/book.py +++ b/pyexcel_io/book.py @@ -4,7 +4,7 @@ The io interface to file extensions - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import warnings diff --git a/pyexcel_io/constants.py b/pyexcel_io/constants.py index aa78a30..25e2823 100644 --- a/pyexcel_io/constants.py +++ b/pyexcel_io/constants.py @@ -4,7 +4,7 @@ Constants appeared in pyexcel - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License """ # flake8: noqa diff --git a/pyexcel_io/database/__init__.py b/pyexcel_io/database/__init__.py index 98c7df4..b7b4c6d 100644 --- a/pyexcel_io/database/__init__.py +++ b/pyexcel_io/database/__init__.py @@ -4,7 +4,7 @@ database data importer and exporter - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugins import IOPluginInfoChainV2 diff --git a/pyexcel_io/database/common.py b/pyexcel_io/database/common.py index 1008c1b..dd0f98d 100644 --- a/pyexcel_io/database/common.py +++ b/pyexcel_io/database/common.py @@ -4,7 +4,7 @@ Common classes shared among database importers and exporters - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ diff --git a/pyexcel_io/database/exporters/django.py b/pyexcel_io/database/exporters/django.py index 018481a..1953ace 100644 --- a/pyexcel_io/database/exporters/django.py +++ b/pyexcel_io/database/exporters/django.py @@ -4,7 +4,7 @@ The lower level handler for django import and export - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugin_api import IReader diff --git a/pyexcel_io/database/exporters/sqlalchemy.py b/pyexcel_io/database/exporters/sqlalchemy.py index dbdc4c7..a1db305 100644 --- a/pyexcel_io/database/exporters/sqlalchemy.py +++ b/pyexcel_io/database/exporters/sqlalchemy.py @@ -4,7 +4,7 @@ The lower level handler for database import and export - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugin_api import IReader diff --git a/pyexcel_io/database/importers/django.py b/pyexcel_io/database/importers/django.py index 1c30f3d..42f464f 100644 --- a/pyexcel_io/database/importers/django.py +++ b/pyexcel_io/database/importers/django.py @@ -4,7 +4,7 @@ The lower level handler for django import and export - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import logging @@ -31,7 +31,7 @@ def __init__(self, importer, adapter, batch_size=None, bulk_save=True): def write_row(self, array): if is_empty_array(array): - print(constants.MESSAGE_EMPTY_ARRAY) + log.warning(constants.MESSAGE_EMPTY_ARRAY) else: new_array = swap_empty_string_for_none(array) if self.mapdict: diff --git a/pyexcel_io/database/importers/sqlalchemy.py b/pyexcel_io/database/importers/sqlalchemy.py index 2cb0c30..db10dc5 100644 --- a/pyexcel_io/database/importers/sqlalchemy.py +++ b/pyexcel_io/database/importers/sqlalchemy.py @@ -4,13 +4,17 @@ The lower level handler for database import and export - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ +import logging + import pyexcel_io.constants as constants from pyexcel_io.utils import is_empty_array, swap_empty_string_for_none from pyexcel_io.plugin_api import IWriter, ISheetWriter +LOG = logging.getLogger(__name__) + class PyexcelSQLSkipRowException(Exception): """ @@ -35,14 +39,14 @@ def __init__( def write_row(self, array): if is_empty_array(array): - print(constants.MESSAGE_EMPTY_ARRAY) + LOG.warning(constants.MESSAGE_EMPTY_ARRAY) else: new_array = swap_empty_string_for_none(array) try: self._write_row(new_array) except PyexcelSQLSkipRowException: - print(constants.MESSAGE_IGNORE_ROW) - print(new_array) + LOG.info(constants.MESSAGE_IGNORE_ROW) + LOG.info(new_array) def _write_row(self, array): new_array = array diff --git a/pyexcel_io/database/querysets.py b/pyexcel_io/database/querysets.py index 6dfc6dd..3ce08da 100644 --- a/pyexcel_io/database/querysets.py +++ b/pyexcel_io/database/querysets.py @@ -4,7 +4,7 @@ The lower level handler for querysets - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import datetime diff --git a/pyexcel_io/exceptions.py b/pyexcel_io/exceptions.py index b6d00aa..2c8ed9f 100644 --- a/pyexcel_io/exceptions.py +++ b/pyexcel_io/exceptions.py @@ -4,7 +4,7 @@ all possible exceptions - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ diff --git a/pyexcel_io/io.py b/pyexcel_io/io.py index 1606f83..8111959 100644 --- a/pyexcel_io/io.py +++ b/pyexcel_io/io.py @@ -4,7 +4,7 @@ The io interface to file extensions - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import os diff --git a/pyexcel_io/manager.py b/pyexcel_io/manager.py index 452ef18..9e15090 100644 --- a/pyexcel_io/manager.py +++ b/pyexcel_io/manager.py @@ -4,7 +4,7 @@ Control file streams - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io._compact import BytesIO, StringIO diff --git a/pyexcel_io/plugins.py b/pyexcel_io/plugins.py index 2a6b12c..495283a 100644 --- a/pyexcel_io/plugins.py +++ b/pyexcel_io/plugins.py @@ -4,7 +4,7 @@ factory for getting readers and writers - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import pyexcel_io.utils as ioutils diff --git a/pyexcel_io/readers/__init__.py b/pyexcel_io/readers/__init__.py index e06ec19..c597292 100644 --- a/pyexcel_io/readers/__init__.py +++ b/pyexcel_io/readers/__init__.py @@ -4,7 +4,7 @@ file readers - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugins import IOPluginInfoChainV2 diff --git a/pyexcel_io/readers/csv_sheet.py b/pyexcel_io/readers/csv_sheet.py index bac6f95..fd6f76c 100644 --- a/pyexcel_io/readers/csv_sheet.py +++ b/pyexcel_io/readers/csv_sheet.py @@ -4,7 +4,7 @@ csv file reader - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import csv diff --git a/pyexcel_io/readers/csvz.py b/pyexcel_io/readers/csvz.py index 4556015..cae0383 100644 --- a/pyexcel_io/readers/csvz.py +++ b/pyexcel_io/readers/csvz.py @@ -4,7 +4,7 @@ The lower level csvz file format handler. - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import zipfile diff --git a/pyexcel_io/service.py b/pyexcel_io/service.py index 02d0a0e..958ee1e 100644 --- a/pyexcel_io/service.py +++ b/pyexcel_io/service.py @@ -4,7 +4,7 @@ provide service code to downstream projects - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import re diff --git a/pyexcel_io/sheet.py b/pyexcel_io/sheet.py index b7c7015..da730e3 100644 --- a/pyexcel_io/sheet.py +++ b/pyexcel_io/sheet.py @@ -4,7 +4,7 @@ The io interface to file extensions - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import pyexcel_io.constants as constants diff --git a/pyexcel_io/utils.py b/pyexcel_io/utils.py index f9f7950..f6f890d 100644 --- a/pyexcel_io/utils.py +++ b/pyexcel_io/utils.py @@ -4,7 +4,7 @@ utility functions - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import pyexcel_io.constants as constants diff --git a/pyexcel_io/writers/__init__.py b/pyexcel_io/writers/__init__.py index 5a8ce4b..2beeaf7 100644 --- a/pyexcel_io/writers/__init__.py +++ b/pyexcel_io/writers/__init__.py @@ -4,7 +4,7 @@ file writers - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugins import IOPluginInfoChainV2 diff --git a/pyexcel_io/writers/csv_sheet.py b/pyexcel_io/writers/csv_sheet.py index f82a67c..422dbed 100644 --- a/pyexcel_io/writers/csv_sheet.py +++ b/pyexcel_io/writers/csv_sheet.py @@ -4,7 +4,7 @@ The lower level csv file format writer - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import csv diff --git a/pyexcel_io/writers/csvz_sheet.py b/pyexcel_io/writers/csvz_sheet.py index 05fd4fd..fe0cd22 100644 --- a/pyexcel_io/writers/csvz_sheet.py +++ b/pyexcel_io/writers/csvz_sheet.py @@ -4,7 +4,7 @@ The lower level csvz file format handler. - :copyright: (c) 2014-2020 by Onni Software Ltd. + :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import csv diff --git a/setup.py b/setup.py index ba6cd9e..90e27da 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ NAME = "pyexcel-io" AUTHOR = "C.W." -VERSION = "0.6.5" +VERSION = "0.6.6" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( @@ -40,7 +40,7 @@ "format and to/from databases" ) URL = "https://github.com/pyexcel/pyexcel-io" -DOWNLOAD_URL = "%s/archive/0.6.5.tar.gz" % URL +DOWNLOAD_URL = "%s/archive/0.6.6.tar.gz" % URL FILES = ["README.rst", "CHANGELOG.rst"] KEYWORDS = [ "python", @@ -87,8 +87,8 @@ PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable) HERE = os.path.abspath(os.path.dirname(__file__)) -GS_COMMAND = ("gease pyexcel-io v0.6.5 " + - "Find 0.6.5 in changelog for more details") +GS_COMMAND = ("gease pyexcel-io v0.6.6 " + + "Find 0.6.6 in changelog for more details") NO_GS_MESSAGE = ("Automatic github release is disabled. " + "Please install gease to enable it.") UPLOAD_FAILED_MSG = (