Hello community, here is the log from the commit of package python-csvkit for openSUSE:Leap:15.2 checked in at 2020-03-27 16:45:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-csvkit (Old) and /work/SRC/openSUSE:Leap:15.2/.python-csvkit.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-csvkit" Fri Mar 27 16:45:06 2020 rev:7 rq:788705 version:1.0.5 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/python-csvkit/python-csvkit.changes 2020-03-09 18:04:16.588785077 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-csvkit.new.3160/python-csvkit.changes 2020-03-27 16:47:31.943912465 +0100 @@ -1,0 +2,10 @@ +Thu Mar 26 12:32:47 UTC 2020 - Paolo Stivanin <[email protected]> + +- update to v1.0.5 + * dropped py 3.4 support + * fix tests + * minor fixes + +- switch from nose to unittest + +------------------------------------------------------------------- Old: ---- csvkit-1.0.4.tar.gz New: ---- csvkit-1.0.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-csvkit.spec ++++++ --- /var/tmp/diff_new_pack.bUWKFn/_old 2020-03-27 16:47:32.343912700 +0100 +++ /var/tmp/diff_new_pack.bUWKFn/_new 2020-03-27 16:47:32.343912700 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-csvkit # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,12 +19,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-csvkit -Version: 1.0.4 +Version: 1.0.5 Release: 0 Summary: A library of utilities for working with CSV License: MIT Group: Development/Languages/Python -Url: https://github.com/wireservice/csvkit +URL: https://github.com/wireservice/csvkit Source: https://files.pythonhosted.org/packages/source/c/csvkit/csvkit-%{version}.tar.gz BuildRequires: %{python_module SQLAlchemy >= 0.9.3} BuildRequires: %{python_module Sphinx >= 1.0.7} @@ -45,7 +45,6 @@ BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module coverage >= 3.5.1b1} -BuildRequires: %{python_module nose >= 1.1.2} BuildRequires: python-mock >= 1.3.0 # /SECTION BuildArch: noarch @@ -71,8 +70,7 @@ %check export LANG=en_US.UTF-8 -# gh#wireservice/csvkit#1027 -%python_expand nosetests-%{$python_bin_suffix} -v -e 'test_(before_after_insert|linenumbers|no_header_row|unicode)' +%python_exec -m unittest discover -s tests/ -v %files %python_files %license COPYING ++++++ csvkit-1.0.4.tar.gz -> csvkit-1.0.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/AUTHORS.rst new/csvkit-1.0.5/AUTHORS.rst --- old/csvkit-1.0.4/AUTHORS.rst 2018-11-21 19:27:32.000000000 +0100 +++ new/csvkit-1.0.5/AUTHORS.rst 2019-11-29 22:51:50.000000000 +0100 @@ -90,3 +90,6 @@ * Connor McArthur * Matěj Cepl * Nicholas Matteo +* Matt Giguere +* Felix Bünemann +* Андрій Орєхов diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/CHANGELOG.rst new/csvkit-1.0.5/CHANGELOG.rst --- old/csvkit-1.0.4/CHANGELOG.rst 2019-03-16 17:25:56.000000000 +0100 +++ new/csvkit-1.0.5/CHANGELOG.rst 2020-03-03 03:59:45.000000000 +0100 @@ -1,3 +1,19 @@ +1.0.5 - March 2, 2020 +--------------------- + +Changes: + +* Dropped Python 3.4 support (end-of-life was March 18, 2019). + +Improvements: + +* Output error message for memory error even if not :code:`--verbose`. + +Fixes: + +* Fix regression in 1.0.4, which caused numbers like ``4.5`` to be parsed as dates. +* :doc:`/scripts/in2csv` Fix error reporting if :code:`--names` used with non-Excel file. + 1.0.4 - March 16, 2019 ---------------------- @@ -183,8 +199,8 @@ * Fix broken csvkit module documentation. (#327) * Fix version of openpyxl to work around encoding issue. (#391, #288) -0.9.0 ------ +0.9.0 - September 8, 2014 +------------------------- * Write missing sections of the tutorial. (#32) * Remove -q arg from sql2csv (conflicts with common flag). @@ -206,8 +222,8 @@ * Implement csvformat. * Fix bug causing CSVKitDictWriter to output 'utf-8' for blank fields. -0.8.0 ------ +0.8.0 - July 27, 2014 +--------------------- * Add pnaimoli to AUTHORS. * Fix column specification in csvstat. (#236) @@ -217,8 +233,8 @@ * Deprecated DBF support for Python 3+. * Add support for Python 3.3 and 3.4 (#239) -0.7.3 ------ +0.7.3 - April 27, 2014 +---------------------- * Fix date handling with openpyxl > 2.0 (#285) * Add Kristina Durivage to AUTHORS. (#243) @@ -233,18 +249,18 @@ * Add Ryan Murphy to AUTHORS. * Fix DBF dependency. (#270) -0.7.2 ------ +0.7.2 - March 24, 2014 +---------------------- * Fix CHANGELOG for release. -0.7.1 ------ +0.7.1 - March 24, 2014 +---------------------- * Fix homepage url in setup.py. -0.7.0 ------ +0.7.0 - March 24, 2014 +---------------------- * Fix XLSX datetime normalization bug. (#223) * Add raistlin7447 to AUTHORS. @@ -259,8 +275,13 @@ * Use case-sensitive name for SQLAlchemy (#237) * Add Travis Swicegood to AUTHORS. -0.6.1 ------ +0.6.1 - August 20, 2013 +----------------------- + +* Fix CHANGELOG for release. + +0.6.0 - August 20, 2013 +----------------------- * Add Chris Rosenthal to AUTHORS. * Fix multi-file input to csvsql. (#193) @@ -279,8 +300,8 @@ * Add Shane StClair to AUTHORS file. * Add --no-inference support to csvsort. (#222) -0.5.0 ------ +0.5.0 - August 21, 2012 +----------------------- * Implement geojson support in csvjson. (#159) * Optimize writing of eight bit codecs. (#175) @@ -292,8 +313,8 @@ * Added Noah Hoffman to AUTHORS. * Make csvlook output compatible with emacs table markup. (#174) -0.4.4 ------ +0.4.4 - May 1, 2012 +------------------- * Add Derek Wilson to AUTHORS. * Add Kevin Schaul to AUTHORS. @@ -307,7 +328,7 @@ * Add Anton Ian Sipos to AUTHORS. * Fix broken pipe errors. (#150) -0.4.3 ------ +0.4.3 - February 20, 2012 +------------------------- * Begin CHANGELOG (a bit late, I'll admit). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/PKG-INFO new/csvkit-1.0.5/PKG-INFO --- old/csvkit-1.0.4/PKG-INFO 2019-03-16 17:27:11.000000000 +0100 +++ new/csvkit-1.0.5/PKG-INFO 2020-03-03 04:00:21.000000000 +0100 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: csvkit -Version: 1.0.4 +Version: 1.0.5 Summary: A suite of command-line tools for working with CSV, the king of tabular file formats. -Home-page: http://csvkit.rtfd.org/ +Home-page: https://github.com/wireservice/csvkit Author: Christopher Groskopf Author-email: [email protected] License: MIT -Description-Content-Type: UNKNOWN Description: .. image:: https://secure.travis-ci.org/wireservice/csvkit.svg :target: https://travis-ci.org/wireservice/csvkit :alt: Build Status @@ -27,6 +26,10 @@ :target: https://pypi.python.org/pypi/csvkit :alt: Support Python versions + .. image:: https://img.shields.io/pypi/dm/csvkit.svg + :target: https://pypi.python.org/pypi/csvkit + :alt: Downloads per month on PyPI + csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats. It is inspired by pdftk, GDAL and the original csvcut tool by Joe Germuska and Aaron Bycoffe. @@ -49,7 +52,6 @@ Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/README.rst new/csvkit-1.0.5/README.rst --- old/csvkit-1.0.4/README.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/README.rst 2019-04-27 18:08:17.000000000 +0200 @@ -18,6 +18,10 @@ :target: https://pypi.python.org/pypi/csvkit :alt: Support Python versions +.. image:: https://img.shields.io/pypi/dm/csvkit.svg + :target: https://pypi.python.org/pypi/csvkit + :alt: Downloads per month on PyPI + csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats. It is inspired by pdftk, GDAL and the original csvcut tool by Joe Germuska and Aaron Bycoffe. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit/cli.py new/csvkit-1.0.5/csvkit/cli.py --- old/csvkit-1.0.4/csvkit/cli.py 2019-01-02 21:16:10.000000000 +0100 +++ new/csvkit-1.0.5/csvkit/cli.py 2019-10-31 22:01:09.000000000 +0100 @@ -140,7 +140,7 @@ # Input if 'f' not in self.override_flags: self.argparser.add_argument(metavar='FILE', nargs='?', dest='input_path', - help='The CSV file to operate on. If omitted, will accept input on STDIN.') + help='The CSV file to operate on. If omitted, will accept input as piped data via STDIN.') if 'd' not in self.override_flags: self.argparser.add_argument('-d', '--delimiter', dest='delimiter', help='Delimiting character of the input CSV file.') @@ -163,7 +163,7 @@ self.argparser.add_argument('-z', '--maxfieldsize', dest='field_size_limit', type=int, help='Maximum length of a single field in the input CSV file.') if 'e' not in self.override_flags: - self.argparser.add_argument('-e', '--encoding', dest='encoding', default='utf-8', + self.argparser.add_argument('-e', '--encoding', dest='encoding', default='utf-8-sig', help='Specify the encoding of the input CSV file.') if 'L' not in self.override_flags: self.argparser.add_argument('-L', '--locale', dest='locale', default='en_US', @@ -200,7 +200,7 @@ self.argparser.add_argument('--zero', dest='zero_based', action='store_true', help='When interpreting or displaying column numbers, use zero-based numbering instead of the default 1-based numbering.') - self.argparser.add_argument('-V', '--version', action='version', version='%(prog)s 1.0.4', + self.argparser.add_argument('-V', '--version', action='version', version='%(prog)s 1.0.5', help='Display version information and exit.') def _open_input_file(self, path): @@ -284,7 +284,7 @@ 'flag or with the PYTHONIOENCODING environment variable. Use the -v flag to see ' 'the complete error.\n' % self.args.encoding) else: - sys.stderr.write('%s\n' % six.text_type(value)) + sys.stderr.write('%s: %s\n' % (t.__name__, six.text_type(value))) sys.excepthook = handler @@ -294,17 +294,27 @@ else: type_kwargs = {} - types = [agate.Text(**type_kwargs)] + text_type = agate.Text(**type_kwargs) - if not self.args.no_inference: + if self.args.no_inference: + types = [text_type] + else: + number_type = agate.Number(locale=self.args.locale, **type_kwargs) + + # See the order in the `agate.TypeTester` class. types = [ agate.Boolean(**type_kwargs), agate.TimeDelta(**type_kwargs), agate.Date(date_format=self.args.date_format, **type_kwargs), agate.DateTime(datetime_format=self.args.datetime_format, **type_kwargs), - # This is a different order than agate's default, in order to parse dates like "20010101". - agate.Number(locale=self.args.locale, **type_kwargs), - ] + types + text_type, + ] + + # In order to parse dates like "20010101". + if self.args.date_format or self.args.datetime_format: + types.insert(-1, number_type) + else: + types.insert(1, number_type) return agate.TypeTester(types=types) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit/utilities/csvpy.py new/csvkit-1.0.5/csvkit/utilities/csvpy.py --- old/csvkit-1.0.4/csvkit/utilities/csvpy.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/csvkit/utilities/csvpy.py 2019-04-27 19:15:52.000000000 +0200 @@ -18,7 +18,7 @@ def main(self): if self.input_file == sys.stdin: - self.argparser.error('csvpy cannot accept input on STDIN (pipe).') + self.argparser.error('csvpy cannot accept input as piped data via STDIN.') # Attempt reading filename, will cause lazy loader to access file and raise error if it does not exist filename = self.input_file.name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit/utilities/csvsql.py new/csvkit-1.0.5/csvkit/utilities/csvsql.py --- old/csvkit-1.0.4/csvkit/utilities/csvsql.py 2018-10-09 20:25:24.000000000 +0200 +++ new/csvkit-1.0.5/csvkit/utilities/csvsql.py 2019-11-29 22:45:45.000000000 +0100 @@ -20,7 +20,7 @@ def add_arguments(self): self.argparser.add_argument(metavar='FILE', nargs='*', dest='input_paths', default=['-'], - help='The CSV file(s) to operate on. If omitted, will accept input on STDIN.') + help='The CSV file(s) to operate on. If omitted, will accept input as piped data via STDIN.') self.argparser.add_argument('-i', '--dialect', dest='dialect', choices=DIALECTS, help='Dialect of SQL to generate. Only valid when --db is not specified.') self.argparser.add_argument('--db', dest='connection_string', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit/utilities/csvstack.py new/csvkit-1.0.5/csvkit/utilities/csvstack.py --- old/csvkit-1.0.4/csvkit/utilities/csvstack.py 2019-01-02 21:16:10.000000000 +0100 +++ new/csvkit-1.0.5/csvkit/utilities/csvstack.py 2019-12-08 01:17:24.000000000 +0100 @@ -9,13 +9,13 @@ class CSVStack(CSVKitUtility): - description = 'Stack up the rows from multiple CSV files, optionally adding a grouping value.' + description = 'Stack up the rows from multiple CSV files, optionally adding a grouping value. Files are assumed to have the same columns in the same order.' # Override 'f' because the utility accepts multiple files. override_flags = ['f', 'L', 'blanks', 'date-format', 'datetime-format'] def add_arguments(self): self.argparser.add_argument(metavar='FILE', nargs='*', dest='input_paths', default=['-'], - help='The CSV file(s) to operate on. If omitted, will accept input on STDIN.') + help='The CSV file(s) to operate on. If omitted, will accept input as piped data via STDIN.') self.argparser.add_argument('-g', '--groups', dest='groups', help='A comma-separated list of values to add as "grouping factors", one for each CSV being stacked. These will be added to the stacked CSV as a new column. You may specify a name for the grouping column using the -n flag.') self.argparser.add_argument('-n', '--group-name', dest='group_name', @@ -27,9 +27,9 @@ if sys.stdin.isatty() and not self.args.input_paths: sys.stderr.write('No input file or piped data provided. Waiting for standard input:\n') - has_groups = self.args.group_by_filenames or self.args.groups + has_groups = self.args.groups is not None or self.args.group_by_filenames - if self.args.groups and not self.args.group_by_filenames: + if self.args.groups is not None and not self.args.group_by_filenames: groups = self.args.groups.split(',') if len(groups) != len(self.args.input_paths): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit/utilities/in2csv.py new/csvkit-1.0.5/csvkit/utilities/in2csv.py --- old/csvkit-1.0.4/csvkit/utilities/in2csv.py 2019-01-02 19:03:46.000000000 +0100 +++ new/csvkit-1.0.5/csvkit/utilities/in2csv.py 2019-05-17 21:25:56.000000000 +0200 @@ -33,7 +33,7 @@ return bytestring self.argparser.add_argument(metavar='FILE', nargs='?', dest='input_path', - help='The CSV file to operate on. If omitted, will accept input on STDIN.') + help='The CSV file to operate on. If omitted, will accept input as piped data via STDIN.') self.argparser.add_argument('-f', '--format', dest='filetype', help='The format of the input file. If not specified will be inferred from the file type. Supported formats: %s.' % ', '.join(sorted(SUPPORTED_FORMATS))) self.argparser.add_argument('-s', '--schema', dest='schema', @@ -66,7 +66,7 @@ input_file = self.open_excel_input_file(path) if filetype == 'xls': sheet_names = xlrd.open_workbook(file_contents=input_file.read()).sheet_names() - elif filetype == 'xlsx': + else: # 'xlsx' sheet_names = openpyxl.load_workbook(input_file, read_only=True, data_only=True).sheetnames input_file.close() return sheet_names @@ -85,14 +85,14 @@ filetype = 'json' else: if not path or path == '-': - self.argparser.error('You must specify a format when providing data via STDIN (pipe).') + self.argparser.error('You must specify a format when providing input as piped data via STDIN.') filetype = convert.guess_format(path) if not filetype: self.argparser.error('Unable to automatically determine the format of the input file. Try specifying a format with --format.') if self.args.names_only: - sheets = self.sheet_names(path, filetype) - if sheets: + if filetype in ('xls', 'xlsx'): + sheets = self.sheet_names(path, filetype) for sheet in sheets: self.output_file.write('%s\n' % sheet) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit/utilities/sql2csv.py new/csvkit-1.0.5/csvkit/utilities/sql2csv.py --- old/csvkit-1.0.4/csvkit/utilities/sql2csv.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/csvkit/utilities/sql2csv.py 2019-04-27 19:16:45.000000000 +0200 @@ -15,7 +15,7 @@ self.argparser.add_argument('--db', dest='connection_string', default='sqlite://', help='An sqlalchemy connection string to connect to a database.',) self.argparser.add_argument(metavar='FILE', nargs='?', dest='input_path', - help='The file to use as SQL query. If both FILE and QUERY are omitted, query will be read from STDIN.') + help='The file to use as SQL query. If both FILE and QUERY are omitted, query will be read as piped data via STDIN.') self.argparser.add_argument('--query', help="The SQL query to execute. If specified, it overrides FILE and STDIN.") self.argparser.add_argument('-e', '--encoding', dest='encoding', default='utf-8', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit.egg-info/PKG-INFO new/csvkit-1.0.5/csvkit.egg-info/PKG-INFO --- old/csvkit-1.0.4/csvkit.egg-info/PKG-INFO 2019-03-16 17:27:10.000000000 +0100 +++ new/csvkit-1.0.5/csvkit.egg-info/PKG-INFO 2020-03-03 04:00:20.000000000 +0100 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: csvkit -Version: 1.0.4 +Version: 1.0.5 Summary: A suite of command-line tools for working with CSV, the king of tabular file formats. -Home-page: http://csvkit.rtfd.org/ +Home-page: https://github.com/wireservice/csvkit Author: Christopher Groskopf Author-email: [email protected] License: MIT -Description-Content-Type: UNKNOWN Description: .. image:: https://secure.travis-ci.org/wireservice/csvkit.svg :target: https://travis-ci.org/wireservice/csvkit :alt: Build Status @@ -27,6 +26,10 @@ :target: https://pypi.python.org/pypi/csvkit :alt: Support Python versions + .. image:: https://img.shields.io/pypi/dm/csvkit.svg + :target: https://pypi.python.org/pypi/csvkit + :alt: Downloads per month on PyPI + csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats. It is inspired by pdftk, GDAL and the original csvcut tool by Joe Germuska and Aaron Bycoffe. @@ -49,7 +52,6 @@ Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/csvkit.egg-info/SOURCES.txt new/csvkit-1.0.5/csvkit.egg-info/SOURCES.txt --- old/csvkit-1.0.4/csvkit.egg-info/SOURCES.txt 2019-03-16 17:27:10.000000000 +0100 +++ new/csvkit-1.0.5/csvkit.egg-info/SOURCES.txt 2020-03-03 04:00:20.000000000 +0100 @@ -66,6 +66,7 @@ examples/bad_skip_lines.csv examples/blanks.csv examples/blanks_converted.csv +examples/date_like_number.csv examples/dummy.csv examples/dummy.csv.bz2 examples/dummy.csv.gz @@ -117,6 +118,7 @@ examples/test_utf16_big.csv examples/test_utf16_little.csv examples/test_utf8.csv +examples/test_utf8_bom.csv examples/testdbf.dbf examples/testdbf_converted.csv examples/testfixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/cli.rst new/csvkit-1.0.5/docs/cli.rst --- old/csvkit-1.0.4/docs/cli.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/cli.rst 2019-04-27 19:10:24.000000000 +0200 @@ -26,6 +26,8 @@ scripts/csvsort scripts/csvstack +To change field values (i.e. to run ``sed`` or ``awk``-like commands on CSV files), consider `miller <https://github.com/johnkerl/miller>`_ (``mlr put``). + To transpose CSVs, consider `csvtool <http://colin.maudry.com/csvtool-manual-page/>`_. Install ``csvtool`` on Linux using your package manager, or on macOS using:: brew install ocaml @@ -33,8 +35,6 @@ ln -s ~/.opam/system/bin/csvtool /usr/local/bin/ csvtool --help -To run ``sed``-like commands on CSV files, consider `csvsed <https://github.com/metagriffin/csvsed>`_. - Output and Analysis =================== @@ -48,7 +48,11 @@ scripts/csvsql scripts/csvstat -To diff CSVs, consider `daff <https://github.com/paulfitz/daff>`_. An alternative to :doc:`csvsql` is `q <https://github.com/harelba/q>`_. +* To draw plots, consider `jp <https://github.com/sgreben/jp>`_. +* To diff CSVs, consider `daff <https://github.com/paulfitz/daff>`_. +* To explore CSVs interactively, consider `VisiData <http://visidata.org>`_. + +Alternatives to :doc:`csvsql` are `q <https://github.com/harelba/q>`_ and `textql <https://github.com/dinedal/textql>`_. Common arguments ================ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/conf.py new/csvkit-1.0.5/docs/conf.py --- old/csvkit-1.0.4/docs/conf.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/conf.py 2019-03-16 17:27:40.000000000 +0100 @@ -41,9 +41,9 @@ # built documents. # # The short X.Y version. -version = '1.0.4' +version = '1.0.5' # The full version, including alpha/beta/rc tags. -release = '1.0.4' +release = '1.0.5' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/index.rst new/csvkit-1.0.5/docs/index.rst --- old/csvkit-1.0.4/docs/index.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/index.rst 2020-02-05 02:51:29.000000000 +0100 @@ -11,10 +11,6 @@ .. note:: - If you need to do more complex data analysis than csvkit can handle, use `agate <https://github.com/wireservice/agate>`_. - -.. note:: - To change the field separator, line terminator, etc. of the **output**, you must use :doc:`/scripts/csvformat`. .. note:: @@ -23,7 +19,7 @@ .. note:: - If you need csvkit to be faster or to handle larger files, you may be reaching the limits of csvkit. + If you need to do more complex data analysis than csvkit can handle, use `agate <https://github.com/wireservice/agate>`_. If you need csvkit to be faster or to handle larger files, you may be reaching the limits of csvkit. Consider loading the data into SQL, or using `xsv <https://github.com/BurntSushi/xsv>`_. Why csvkit? =========== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvclean.rst new/csvkit-1.0.5/docs/scripts/csvclean.rst --- old/csvkit-1.0.4/docs/scripts/csvclean.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvclean.rst 2019-04-27 19:18:53.000000000 +0200 @@ -29,7 +29,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvcut.rst new/csvkit-1.0.5/docs/scripts/csvcut.rst --- old/csvkit-1.0.4/docs/scripts/csvcut.rst 2018-11-08 04:18:33.000000000 +0100 +++ new/csvkit-1.0.5/docs/scripts/csvcut.rst 2019-04-27 19:18:53.000000000 +0200 @@ -18,7 +18,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvformat.rst new/csvkit-1.0.5/docs/scripts/csvformat.rst --- old/csvkit-1.0.4/docs/scripts/csvformat.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvformat.rst 2019-04-27 19:18:53.000000000 +0200 @@ -18,7 +18,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvgrep.rst new/csvkit-1.0.5/docs/scripts/csvgrep.rst --- old/csvkit-1.0.4/docs/scripts/csvgrep.rst 2018-09-20 19:11:36.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvgrep.rst 2019-04-27 19:18:53.000000000 +0200 @@ -17,7 +17,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvjoin.rst new/csvkit-1.0.5/docs/scripts/csvjoin.rst --- old/csvkit-1.0.4/docs/scripts/csvjoin.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvjoin.rst 2019-12-08 01:14:24.000000000 +0100 @@ -58,8 +58,10 @@ csvjoin -c 1 examples/join_a.csv examples/join_b.csv -This command says you have two files to outer join, file1.csv and file2.csv. The key column in file1.csv is ColumnKey, the key column in file2.csv is Column Key. - Add two empty columns to the right of a CSV:: echo "," | csvjoin examples/dummy.csv - + +Add a single column to the right of a CSV:: + + echo "new-column" | csvjoin examples/dummy.csv - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvjson.rst new/csvkit-1.0.5/docs/scripts/csvjson.rst --- old/csvkit-1.0.4/docs/scripts/csvjson.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvjson.rst 2019-04-27 19:18:53.000000000 +0200 @@ -19,7 +19,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvlook.rst new/csvkit-1.0.5/docs/scripts/csvlook.rst --- old/csvkit-1.0.4/docs/scripts/csvlook.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvlook.rst 2019-04-27 19:18:53.000000000 +0200 @@ -20,7 +20,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvpy.rst new/csvkit-1.0.5/docs/scripts/csvpy.rst --- old/csvkit-1.0.4/docs/scripts/csvpy.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvpy.rst 2019-04-27 19:18:53.000000000 +0200 @@ -18,7 +18,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit @@ -29,7 +29,7 @@ .. note:: - Due to platform limitations, csvpy does not accept file input on STDIN. + Due to platform limitations, csvpy does not accept file input as piped data via STDIN. See also: :doc:`../common_arguments`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvsort.rst new/csvkit-1.0.5/docs/scripts/csvsort.rst --- old/csvkit-1.0.4/docs/scripts/csvsort.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvsort.rst 2019-04-27 19:18:53.000000000 +0200 @@ -18,7 +18,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvsql.rst new/csvkit-1.0.5/docs/scripts/csvsql.rst --- old/csvkit-1.0.4/docs/scripts/csvsql.rst 2019-02-23 19:26:21.000000000 +0100 +++ new/csvkit-1.0.5/docs/scripts/csvsql.rst 2020-02-04 16:33:59.000000000 +0100 @@ -25,7 +25,7 @@ positional arguments: FILE The CSV file(s) to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit @@ -76,11 +76,14 @@ If you prefer not to enter your password in the connection string, store the password securely in a `PostgreSQL Password File <https://www.postgresql.org/docs/9.1/static/libpq-pgpass.html>`_, a `MySQL Options File <https://dev.mysql.com/doc/refman/5.7/en/option-files.html>`_ or similar files for other systems. - .. note:: Using the :code:`--query` option may cause rounding (in Python 2) or introduce [Python floating point issues](https://docs.python.org/3.4/tutorial/floatingpoint.html) (in Python 3). +.. note:: + + Alternatives to :doc:`csvsql` are `q <https://github.com/harelba/q>`_ and `textql <https://github.com/dinedal/textql>`_. + Examples ======== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvstack.rst new/csvkit-1.0.5/docs/scripts/csvstack.rst --- old/csvkit-1.0.4/docs/scripts/csvstack.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvstack.rst 2019-12-08 01:20:36.000000000 +0100 @@ -14,10 +14,11 @@ FILE [FILE ...] Stack up the rows from multiple CSV files, optionally adding a grouping value. + Files are assumed to have the same columns in the same order. positional arguments: FILE The CSV file(s) to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit @@ -45,3 +46,7 @@ Contrived example: joining a set of homogoenous files for different years:: csvstack -g 2009,2010 examples/realdata/FY09_EDU_Recipients_by_State.csv examples/realdata/Datagov_FY10_EDU_recp_by_State.csv + +Add a single column to the left of a CSV:: + + csvstack -n NEWCOL -g "" examples/dummy.csv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/csvstat.rst new/csvkit-1.0.5/docs/scripts/csvstat.rst --- old/csvkit-1.0.4/docs/scripts/csvstat.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/scripts/csvstat.rst 2019-04-27 19:18:54.000000000 +0200 @@ -19,7 +19,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/scripts/in2csv.rst new/csvkit-1.0.5/docs/scripts/in2csv.rst --- old/csvkit-1.0.4/docs/scripts/in2csv.rst 2019-03-01 04:19:33.000000000 +0100 +++ new/csvkit-1.0.5/docs/scripts/in2csv.rst 2019-04-27 19:18:54.000000000 +0200 @@ -29,7 +29,7 @@ positional arguments: FILE The CSV file to operate on. If omitted, will accept - input on STDIN. + input as piped data via STDIN. optional arguments: -h, --help show this help message and exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/tricks.rst new/csvkit-1.0.5/docs/tricks.rst --- old/csvkit-1.0.4/docs/tricks.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/tricks.rst 2019-07-26 04:25:41.000000000 +0200 @@ -15,13 +15,6 @@ Please note, the files are decompressed in memory, so this is a convenience, not an optimization. -Reading a CSV with a byte-order mark (BOM) ------------------------------------------- - -Set the encoding to ``utf-8-sig``, for example:: - - csvcut -e utf-8-sig -c column1 csv-with-bom.csv - Specifying STDIN as a file -------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/docs/tutorial/1_getting_started.rst new/csvkit-1.0.5/docs/tutorial/1_getting_started.rst --- old/csvkit-1.0.4/docs/tutorial/1_getting_started.rst 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/docs/tutorial/1_getting_started.rst 2019-06-03 21:24:32.000000000 +0200 @@ -112,7 +112,7 @@ 13: federal_supply_class 14: federal_supply_class_name -As you'll can see, our dataset has fourteen columns. Let's take a look at just columns ``2``, ``5`` and ``6``: +As you can see, our dataset has fourteen columns. Let's take a look at just columns ``2``, ``5`` and ``6``: .. code-block:: bash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/examples/date_like_number.csv new/csvkit-1.0.5/examples/date_like_number.csv --- old/csvkit-1.0.4/examples/date_like_number.csv 1970-01-01 01:00:00.000000000 +0100 +++ new/csvkit-1.0.5/examples/date_like_number.csv 2019-10-31 22:00:45.000000000 +0100 @@ -0,0 +1,2 @@ +a +4.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/examples/test_utf8_bom.csv new/csvkit-1.0.5/examples/test_utf8_bom.csv --- old/csvkit-1.0.4/examples/test_utf8_bom.csv 1970-01-01 01:00:00.000000000 +0100 +++ new/csvkit-1.0.5/examples/test_utf8_bom.csv 2019-07-26 04:25:41.000000000 +0200 @@ -0,0 +1,3 @@ +foo,bar,baz +1,2,3 +4,5,ʤ \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/setup.py new/csvkit-1.0.5/setup.py --- old/csvkit-1.0.4/setup.py 2019-02-23 17:57:27.000000000 +0100 +++ new/csvkit-1.0.5/setup.py 2019-11-29 22:51:29.000000000 +0100 @@ -18,12 +18,15 @@ setup( name='csvkit', - version='1.0.4', + version='1.0.5', description='A suite of command-line tools for working with CSV, the king of tabular file formats.', long_description=open('README.rst').read(), author='Christopher Groskopf', author_email='[email protected]', - url='http://csvkit.rtfd.org/', + url='https://github.com/wireservice/csvkit', + project_urls={ + 'Documentation': 'https://csvkit.readthedocs.io/en/latest/', + }, license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -36,7 +39,6 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_csvclean.py new/csvkit-1.0.5/tests/test_utilities/test_csvclean.py --- old/csvkit-1.0.4/tests/test_utilities/test_csvclean.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_csvclean.py 2019-07-26 04:25:41.000000000 +0200 @@ -100,6 +100,13 @@ '4,5,©\n', ], [], ['-e', 'latin1']) + def test_removes_bom(self): + self.assertCleaned('test_utf8_bom', [ + 'foo,bar,baz\n', + '1,2,3\n', + '4,5,ʤ\n', + ], [], []) + def test_dry_run(self): output = self.get_output_as_io(['-n', 'examples/bad.csv']) self.assertFalse(os.path.exists('examples/bad_err.csv')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_csvgrep.py new/csvkit-1.0.5/tests/test_utilities/test_csvgrep.py --- old/csvkit-1.0.4/tests/test_utilities/test_csvgrep.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_csvgrep.py 2019-07-26 04:25:41.000000000 +0200 @@ -45,6 +45,12 @@ ['4', '5', u'ʤ'], ]) + def test_match_utf8_bom(self): + self.assertRows(['-c', '3', '-m', 'ʤ', 'examples/test_utf8_bom.csv'], [ + ['foo', 'bar', 'baz'], + ['4', '5', u'ʤ'], + ]) + def test_no_match(self): self.assertRows(['-c', '1', '-m', 'NO MATCH', 'examples/dummy.csv'], [ ['a', 'b', 'c'], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_csvlook.py new/csvkit-1.0.5/tests/test_utilities/test_csvlook.py --- old/csvkit-1.0.4/tests/test_utilities/test_csvlook.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_csvlook.py 2019-11-29 22:55:57.000000000 +0100 @@ -22,10 +22,26 @@ launch_new_instance() def test_runs(self): - self.get_output(['examples/test_utf8.csv']) + if sys.version_info < (3,): + self.get_output(['examples/test_utf8.csv']) + else: + self.assertLines(['examples/test_utf8.csv'], [ + '| foo | bar | baz |', + '| --- | --- | --- |', + '| 1 | 2 | 3 |', + '| 4 | 5 | ʤ |', + ]) def test_encoding(self): - self.get_output(['-e', 'latin1', 'examples/test_latin1.csv']) + if sys.version_info < (3,): + self.get_output(['-e', 'latin1', 'examples/test_latin1.csv']) + else: + self.assertLines(['-e', 'latin1', 'examples/test_latin1.csv'], [ + '| a | b | c |', + '| - | - | - |', + '| 1 | 2 | 3 |', + '| 4 | 5 | © |', + ]) def test_simple(self): self.assertLines(['examples/dummy3.csv'], [ @@ -62,6 +78,14 @@ '| foo | bar | baz |', '| --- | --- | --- |', '| 1 | 2 | 3 |', + u'| 4 | 5 | ʤ |', + ]) + + def test_unicode_bom(self): + self.assertLines(['examples/test_utf8_bom.csv'], [ + '| foo | bar | baz |', + '| --- | --- | --- |', + '| 1 | 2 | 3 |', u'| 4 | 5 | ʤ |', ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_csvsort.py new/csvkit-1.0.5/tests/test_utilities/test_csvsort.py --- old/csvkit-1.0.4/tests/test_utilities/test_csvsort.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_csvsort.py 2019-11-29 22:55:53.000000000 +0100 @@ -22,10 +22,24 @@ launch_new_instance() def test_runs(self): - self.get_output(['examples/test_utf8.csv']) + if sys.version_info < (3,): + self.get_output(['examples/test_utf8.csv']) + else: + self.assertRows(['examples/test_utf8.csv'], [ + ['foo', 'bar', 'baz'], + ['1', '2', '3'], + ['4', '5', 'ʤ'], + ]) def test_encoding(self): - self.get_output(['-e', 'latin1', 'examples/test_latin1.csv']) + if sys.version_info < (3,): + self.get_output(['-e', 'latin1', 'examples/test_latin1.csv']) + else: + self.assertRows(['-e', 'latin1', 'examples/test_latin1.csv'], [ + ['a', 'b', 'c'], + ['1', '2', '3'], + ['4', '5', '©'], + ]) def test_sort_string_reverse(self): reader = self.get_output_as_reader(['-c', '1', '-r', 'examples/testxls_converted.csv']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_csvsql.py new/csvkit-1.0.5/tests/test_utilities/test_csvsql.py --- old/csvkit-1.0.4/tests/test_utilities/test_csvsql.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_csvsql.py 2019-11-29 22:46:02.000000000 +0100 @@ -197,7 +197,7 @@ utility.run() output = output_file.getvalue() output_file.close() - self.assertEqual(output, 'a,b,c\n1,2,3\n0,5,6\n') + self.assertEqual(output, 'a,b,c\n1,2.0,3.0\n0,5.0,6.0\n') def test_no_prefix_unique_constraint(self): self.get_output(['--db', 'sqlite:///' + self.db_file, '--insert', 'examples/dummy.csv', '--unique-constraint', 'a']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_csvstat.py new/csvkit-1.0.5/tests/test_utilities/test_csvstat.py --- old/csvkit-1.0.4/tests/test_utilities/test_csvstat.py 2018-09-20 19:11:36.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_csvstat.py 2019-11-29 22:42:14.000000000 +0100 @@ -23,16 +23,18 @@ launch_new_instance() def test_runs(self): + # Test that csvstat doesn't error on UTF-8 input. self.get_output(['examples/test_utf8.csv']) + def test_encoding(self): + # Test that csvstat doesn't error on Latin-1 input. + self.get_output(['-e', 'latin1', 'examples/test_latin1.csv']) + def test_columns(self): output = self.get_output(['-c', '2', 'examples/testxls_converted.csv']) self.assertNotIn('1. "text"', output) self.assertIn('2. "date"', output) - def test_encoding(self): - self.get_output(['-e', 'latin1', 'examples/test_latin1.csv']) - def test_linenumbers(self): output = self.get_output(['-c', '2', '--linenumbers', 'examples/dummy.csv']) self.assertNotIn('1. "a"', output) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_in2csv.py new/csvkit-1.0.5/tests/test_utilities/test_in2csv.py --- old/csvkit-1.0.4/tests/test_utilities/test_in2csv.py 2019-02-23 17:57:27.000000000 +0100 +++ new/csvkit-1.0.5/tests/test_utilities/test_in2csv.py 2019-10-31 22:00:32.000000000 +0100 @@ -47,9 +47,18 @@ def test_date_format(self): self.assertConverted('csv', 'examples/test_date_format.csv', 'examples/test_date_format_converted.csv', ['--date-format', '%d/%m/%Y']) + def test_date_format_default(self): + self.assertConverted('csv', 'examples/test_date_format.csv', 'examples/test_date_format.csv') + def test_numeric_date_format(self): self.assertConverted('csv', 'examples/test_numeric_date_format.csv', 'examples/test_date_format_converted.csv', ['--date-format', '%Y%m%d']) + def test_numeric_date_format_default(self): + self.assertConverted('csv', 'examples/test_numeric_date_format.csv', 'examples/test_numeric_date_format.csv') + + def test_date_like_number(self): + self.assertConverted('csv', 'examples/date_like_number.csv', 'examples/date_like_number.csv') + def test_convert_csv(self): self.assertConverted('csv', 'examples/testfixed_converted.csv', 'examples/testfixed_converted.csv') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvkit-1.0.4/tests/test_utilities/test_sql2csv.py new/csvkit-1.0.5/tests/test_utilities/test_sql2csv.py --- old/csvkit-1.0.4/tests/test_utilities/test_sql2csv.py 2018-09-20 19:09:31.000000000 +0200 +++ new/csvkit-1.0.5/tests/test_utilities/test_sql2csv.py 2019-11-29 22:42:07.000000000 +0100 @@ -45,7 +45,7 @@ if not db: db = 'sqlite:///' + self.db_file - args = ['--db', db, '--tables', 'foo', '--insert', csv_file] + args = ['--db', db, '--tables', 'foo', '--insert', csv_file, '--no-inference'] utility = CSVSQL(args) utility.run() @@ -56,6 +56,7 @@ return text.strip() def test_encoding(self): + # Test that csvstat doesn't error on Latin-1 input. self.get_output(['-e', 'latin1', 'examples/test.sql']) def test_query(self):
