Skip to content

Commit

Permalink
Merge pull request #113 from pyexcel/dev
Browse files Browse the repository at this point in the history
0.6.6 - minor update on log
  • Loading branch information
chfw authored Jan 29, 2022
2 parents 39a3658 + 1caf894 commit 7fea448
Show file tree
Hide file tree
Showing 34 changed files with 68 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python package
name: Unit tests on ubuntu

on: [push]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run_tests
name: Run unit tests on Windows and Mac

on: [push, pull_request]

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change log
================================================================================

0.6.6 - 31.1.2022
--------------------------------------------------------------------------------

**updated**

#. `#112 <https://github.com/pyexcel/pyexcel-io/issues/112>`_: Log Empty Row
Warning instead 'print'

0.6.5 - 08.10.2021
--------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ In alphabetical order:
* `John Vandenberg <https://github.com/jayvdb>`_
* `Stephen J. Fuhry <https://github.com/fuhrysteve>`_
* `Stephen Rauch <https://github.com/stephenrauch>`_
* `vinraspa <https://github.com/vinraspa>`_
* `Vincent Raspal <https://github.com/vinraspa>`_
* `Víctor Antonio Hernández Monroy <https://github.com/antherkiv>`_
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions changelog.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------

Expand Down
12 changes: 7 additions & 5 deletions docs/source/extensions.rst
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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**

Expand Down
8 changes: 4 additions & 4 deletions pyexcel-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/_compact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/database/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/database/exporters/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/database/exporters/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyexcel_io/database/importers/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
12 changes: 8 additions & 4 deletions pyexcel_io/database/importers/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/database/querysets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/readers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/readers/csv_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/readers/csvz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/writers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/writers/csv_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyexcel_io/writers/csvz_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 7fea448

Please sign in to comment.