From c5d4ea5fb79a42eb2a7366ca453fcb0dfb30fcea1e884a596515298568b13200 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Tue, 5 Jun 2018 10:53:09 +0000 Subject: [PATCH] Accepting request 614041 from devel:languages:python library of utilities for working with CSV OBS-URL: https://build.opensuse.org/request/show/614041 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-csvkit?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + csvkit-1.0.3.tar.gz | 3 + python-csvkit.changes | 246 ++++++++++++++++++++++++++++++++++++++++++ python-csvkit.spec | 84 +++++++++++++++ 5 files changed, 357 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 csvkit-1.0.3.tar.gz create mode 100644 python-csvkit.changes create mode 100644 python-csvkit.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/csvkit-1.0.3.tar.gz b/csvkit-1.0.3.tar.gz new file mode 100644 index 0000000..89d3599 --- /dev/null +++ b/csvkit-1.0.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6c859c1321d4697dc41252877249091681297f093e08d9c1e1828a6d52c260c +size 3780150 diff --git a/python-csvkit.changes b/python-csvkit.changes new file mode 100644 index 0000000..48a5b7a --- /dev/null +++ b/python-csvkit.changes @@ -0,0 +1,246 @@ +------------------------------------------------------------------- +Mon Jun 4 16:17:01 UTC 2018 - toddrme2178@gmail.com + +- Remove unneded dependencies + +------------------------------------------------------------------- +Wed May 16 16:20:31 UTC 2018 - toddrme2178@gmail.com + +- Update to 1.0.3 + + Improvements: + * :doc:`/scripts/csvgrep` adds a :code:`--any-match` (:code:`-a`) flag to select rows where any column matches instead of all columns. + * :doc:`/scripts/csvjson` no longer emits a property if its value is null. + * :doc:`/scripts/csvjson` adds :code:`--type` and :code:`--geometry` options to emit non-Point GeoJSON features. + * :doc:`/scripts/csvjson` adds a :code:`--no-bbox` option to disable the calculation of a bounding box. + * :doc:`/scripts/csvjson` supports :code:`--stream` for newline-delimited GeoJSON. + * :doc:`/scripts/csvsql` adds a :code:`--unique-constraint` option to list names of columns to include in a UNIQUE constraint. + * :doc:`/scripts/csvsql` adds :code:`--before-insert` and :code:`--after-insert` options to run commands before and after the INSERT command. + * :doc:`/scripts/csvpy` reports an error message if input is provided via STDIN. + * :doc:`/scripts/in2csv` adds a :code:`--encoding-xls` option to specify the encoding of the input XLS file. + * :doc:`/scripts/in2csv` supports :code:`--no-header-row` on XLS and XLSX files. + * Suppress agate warning about column names not specified when using :code:`--no-header-row`. + * Prompt the user if additional input is expected (i.e. if no input file or piped data is provided). + * Update to `agate-excel 0.2.2 `_, `agate-sql 0.5.3 `_. + + Fixes: + * :doc:`/scripts/csvgrep` accepts utf-8 arguments to the :code:`--match` and :code:`--regex` options in Python 2. + * :doc:`/scripts/csvjson` streams input and output only if :code:`--snifflimit` is :code:`0`. + * :doc:`/scripts/csvsql` sets a DECIMAL's precision and scale and a VARCHAR's length to avoid dialect-specific errors. + * :doc:`/scripts/csvstack` no longer opens all files at once. + * :doc:`/scripts/in2csv` respects :code:`--no-header-row` when :code:`--no-inference` is set. + * :doc:`/scripts/in2csv` CSV-to-CSV conversion streams input and output only if :code:`--snifflimit` is :code:`0`. + * :doc:`/scripts/in2csv` supports GeoJSON files with: ``geometry`` set to ``null``, missing Point ``coordinates``, altitude coordinate values. + + csvkit is no longer tested on PyPy. +- Update to 1.0.2 + + Improvements: + * Add a :code:`--version` flag. + * Add a :code:`--skip-lines` option to skip initial lines (e.g. comments, copyright notices, empty rows). + * Add a :code:`--locale` option to set the locale of any formatted numbers. + * Add a :code:`--date-format` option to set a strptime date format string. + * Add a :code:`--datetime-format` option to set a strptime datetime format string. + * Make :code:`--blanks` a common argument across all tools. + * :code:`-I` is the short option for :code:`--no-inference`. + * :doc:`/scripts/csvclean`, :doc:`/scripts/csvformat`, :doc:`/scripts/csvjson`, :doc:`/scripts/csvpy` support :code:`--no-header-row`. + * :doc:`/scripts/csvclean` is faster and no longer requires exponential time in the worst case. + * :doc:`/scripts/csvformat` supports :code:`--linenumbers` and `--zero` (no-op). + * :doc:`/scripts/csvjoin` supports :code:`--snifflimit` and :code:`--no-inference`. + * :doc:`/scripts/csvpy` supports :code:`--linenumbers` (no-op) and :code:`--zero` (no-op). + * :doc:`/scripts/csvsql` adds a :code:`--prefix` option to add expressions like OR IGNORE or OR REPLACE following the INSERT keyword. + * :doc:`/scripts/csvsql` adds a :code:`--overwrite` flag to drop any existing table with the same name before creating. + * :doc:`/scripts/csvsql` accepts a file name for the :code:`--query` option. + * :doc:`/scripts/csvsql` supports :code:`--linenumbers` (no-op). + * :doc:`/scripts/csvsql` adds a :code:`--create-if-not-exists` flag to not abort if the table already exists. + * :doc:`/scripts/csvstat` adds a :code:`--freq-count` option to set the maximum number of frequent values to display. + * :doc:`/scripts/csvstat` supports :code:`--linenumbers` (no-op). + * :doc:`/scripts/in2csv` adds a :code:`--names` flag to print Excel sheet names. + * :doc:`/scripts/in2csv` adds a :code:`--write-sheets` option to write the named Excel sheets to files. + * :doc:`/scripts/sql2csv` adds an :code:`--encoding` option to specify the encoding of the input query file. + + Fixes: + * :doc:`/scripts/csvgrep` no longer ignores common arguments if :code:`--linenumbers` is set. + * :doc:`/scripts/csvjson` supports Decimal. + * :doc:`/scripts/csvpy` again supports IPython. + * :doc:`/scripts/csvsql` restores support for :code:`--no-constraints` and :code:`--db-schema`. + * :doc:`/scripts/csvstat` will no longer crash when :code:`--freq` is set. + * :doc:`/scripts/in2csv` restores support for :code:`--no-inference` for Excel files. + * :doc:`/scripts/in2csv` restores support for converting Excel files from standard input. + * :doc:`/scripts/in2csv` accepts utf-8 arguments to the :code:`--sheet` option in Python 2. +- Update to 1.0.1 + * :doc:`/scripts/csvstat` will no longer crash when a :code:`Number` column has :code:`None` as a frequent value. (#738) + * :doc:`/scripts/csvlook` docs now note that output tables are Markdown-compatible. (#734) + * :doc:`/scripts/csvstat` now supports a :code:`--csv` flag for tabular output. (#584) + * :doc:`/scripts/csvstat` output is now easier to read. (#714) + * :doc:`/scripts/csvpy` now has a better description when using the :code:`--agate` flag. (#729) + * Fix a Python 2.6 bug preventing :doc:`/scripts/csvjson` from parsing utf-8 files. (#732) + * Update required version of unittest to latest. (#727) +- Update to 1.0.0 + + Backwards-incompatible changes: + * :doc:`/scripts/csvjoin` now renames duplicate columns with integer suffixes to prevent collisions in output. + * :doc:`/scripts/csvsql` now generates ``DateTime`` columns instead of ``Time`` columns. + * :doc:`/scripts/csvsql` now generates ``Decimal`` columns instead of ``Integer``, ``BigInteger``, and ``Float`` columns. + * :doc:`/scripts/csvsql` no longer generates max-length constraints for text columns. + * The ``--doublequote`` long flag is gone, and the ``-b`` short flag is now an alias for ``--no-doublequote``. + * When using the ``--columns`` or ``--not-columns`` options, you must not have spaces around the comma-separated values, unless the column names contain spaces. + * When sorting, null values are now greater than other values instead of less than. + * ``CSVKitReader``, ``CSVKitWriter``, ``CSVKitDictReader``, and ``CSVKitDictWriter`` have been removed. Use ``agate.csv.reader``, ``agate.csv.writer``, ``agate.csv.DictReader`` and ``agate.csv.DictWriter``. + * Dropped support for older versions of PyPy. + * Dropped Python 2.6 support. + * If ``--no-header-row`` is set, the output will have column names ``a``, ``b``, ``c``, etc. instead of ``column1``, ``column2``, ``column3``, etc. + * csvlook renders a simpler, markdown-compatible table. + + Improvements: + * csvkit is now tested against Python 3.6. (#702) + * ``import csvkit as csv`` will now defer to agate readers/writers. + * :doc:`/scripts/csvgrep` supports ``--no-header-row``. + * :doc:`/scripts/csvjoin` supports ``--no-header-row``. + * :doc:`/scripts/csvjson` streams input and output if the ``--stream`` and ``--no-inference`` flags are set. + * :doc:`/scripts/csvjson` supports ``--snifflimit`` and ``--no-inference``. + * :doc:`/scripts/csvlook` adds ``--max-rows``, ``--max-columns`` and ``--max-column-width`` options. + * :doc:`/scripts/csvlook` supports ``--snifflimit`` and ``--no-inference``. + * :doc:`/scripts/csvpy` supports ``--agate`` to read a CSV file into an agate table. + * ``csvsql`` supports custom `SQLAlchemy dialects `_. + * :doc:`/scripts/csvstat` supports ``--names``. + * :doc:`/scripts/in2csv` CSV-to-CSV conversion streams input and output if the ``--no-inference`` flag is set. + * :doc:`/scripts/in2csv` CSV-to-CSV conversion uses ``agate.Table``. + * :doc:`/scripts/in2csv` GeoJSON conversion adds columns for geometry type, longitude and latitude. + * Documentation: Update tool usage, remove shell prompts, document connection string, correct typos. + + Fixes: + * Fixed numerous instances of open files not being closed before utilities exit. + * Change ``-b``, ``--doublequote`` to ``--no-doublequote``, as doublequote is True by default. + * :doc:`/scripts/in2csv` DBF conversion works with Python 3. + * :doc:`/scripts/in2csv` correctly guesses format when file has an uppercase extension. + * :doc:`/scripts/in2csv` correctly interprets ``--no-inference``. + * :doc:`/scripts/in2csv` again supports nested JSON objects (fixes regression). + * :doc:`/scripts/in2csv` with ``--format geojson`` will print a JSON object instead of ``OrderedDict([(...)])``. + * :doc:`/scripts/csvclean` with standard input works on Windows. + * :doc:`/scripts/csvgrep` returns the input file's line numbers if the ``--linenumbers`` flag is set. + * :doc:`/scripts/csvgrep` can match multiline values. + * :doc:`/scripts/csvgrep` correctly operates on ragged rows. + * :doc:`/scripts/csvsql` correctly escapes ``%``` characters in SQL queries. + * :doc:`/scripts/csvsql` adds standard input only if explicitly requested. + * :doc:`/scripts/csvstack` supports stacking a single file. + * :doc:`/scripts/csvstat` always reports frequencies. + * The ``any_match`` argument of ``FilteringCSVReader`` now works correctly. + * All tools handle empty files without error. + +------------------------------------------------------------------- +Sun Jul 30 15:07:03 UTC 2017 - bruno@ioda-net.ch + +- Packaging : move to python singlespec + + application are only py3 (no more alternatives) + + fix copyright year + + disable require on sphinx we don't have doc in pypi tar + + use files.pythonhosted.org + + remove shebang + + adjust too strict version with sed in setup.py +- This update prepare the changes in version >1 with agathe + +------------------------------------------------------------------- +Fri Feb 26 13:04:24 UTC 2016 - tbechtold@suse.com + +- Require python-python-dateutil. package was renamed + +------------------------------------------------------------------- +Thu Dec 10 17:39:40 UTC 2015 - bruno@ioda-net.ch + +- Update to version 0.9.1: + + Typo correction. + + updated Kansas example data URL + + Fix csvsort -c help text. Closes #373. + + Add Dave Stanton to AUTHORS. + + Fix typo. Closes #378. + + Fix openpyxl version to work around bug. Closes #391. + Rev down to 0.9.1 for imminent release. + + Rev to 0.9.2 for dev. + + in2csv: Support uppercase file extensions when guessing format. + +- Packaging: + + spec-cleaner + + packaging with update-alternatives support for python3 + package + + Added python-dbf and python-et_xmlfile as dependences + + Add BuildRoot for fixing SLE_11 builds + +------------------------------------------------------------------- +Sun Mar 8 17:31:57 UTC 2015 - benoit.monin@gmx.fr + +- update to version 0.9.0: + * Write missing sections of the tutorial. (#32) + * Remove -q arg from sql2csv (conflicts with common flag). + * Fix csvjoin in case where left dataset rows without all columns. + * Rewrote tutorial based on LESO data. (#324) + * Don't error in csvjson if lat/lon columns are null. (#326) + * Maintain field order in output of csvjson. + * Add unit test for json in2csv. (#77) + * Maintain key order when converting JSON into CSV. (#325.) + * Upgrade python-dateutil to version 2.2 (#304) + * Fix sorting of columns with null values. (#302) + * Added release documentation. + * Fill out short rows with null values. (#313) + * Fix unicode output for csvlook and csvstat. (#315) + * Add documentation for --zero. (#323) + * Fix Integrity error when inserting zero rows in database with + csvsql. (#299) + * Add --count option to CSVStat. + * Implement csvformat. + * Fix bug causing CSVKitDictWriter to output 'utf-8' for blank + fields. +- additional changes from 0.8.0: + * Fix column specification in csvstat. (#236) + * Added "Tips and Tricks" documentation. (#297, #298) + * Remove unnecessary enumerate calls. (#292) + * Deprecated DBF support for Python 3+. + * Add support for Python 3.3 and 3.4 (#239) +- additional changes from 0.7.3 + * Fix date handling with openpyxl > 2.0 (#285) + * Support SQL queries "directly" on CSV files. (#276) + * Fix off-by-one error in open ended column ranges. (#238) + * Add line numbers flag to csvlook (#244) + * Only install argparse for Python < 2.7. (#224) + * Fix DBF dependency. (#270) +- additional changes from 0.7.2 + * Fix CHANGELOG for release. +- additional changes from 0.7.1 + * Fix homepage url in setup.py. +- additional changes from 0.7.0 + * Fix XLSX datetime normalization bug. (#223) + * Merged sql2csv utility (#259). + * Validate csvsql DB connections before parsing CSVs. (#257) + * Clarify install process for Ubuntu. (#249) + * Clarify docs for --escapechar. (#242) + * Make ``import csvkit`` API compatible with ``import csv``. + * Update Travis CI link. (#258) + * Use case-sensitive name for SQLAlchemy (#237) +- update URL +- add python-six as dependency +- rework the removal of shebangs to make it more generic +- add sql2csv to the package file + +------------------------------------------------------------------- +Fri Sep 27 00:42:56 UTC 2013 - p.drouand@gmail.com + +- Update to version 0.6.1 + + No changelog available + +------------------------------------------------------------------- +Wed Jul 31 14:10:13 UTC 2013 - hpj@urpla.net + +- Update to version 0.5.0 + +------------------------------------------------------------------- +Fri Sep 23 13:59:43 UTC 2011 - saschpe@suse.de + +- Update to version 0.3.0 + +------------------------------------------------------------------- +Wed Aug 31 14:48:46 UTC 2011 - saschpe@suse.de + +- Update to version 0.2.5: + * Use proper tarball +- Regenerated with py2pack: + * Proper version checks around fdupes + * Simpler Buildrequires + * Fixed several rpmlint issues (non-excutable scripts, summary) + +------------------------------------------------------------------- +Mon Aug 22 23:31:29 CEST 2011 - hpj@urpla.net + +- initial package version 0.2.4 git 3f0d6c2 + diff --git a/python-csvkit.spec b/python-csvkit.spec new file mode 100644 index 0000000..5207c1d --- /dev/null +++ b/python-csvkit.spec @@ -0,0 +1,84 @@ +# +# spec file for package python-csvkit +# +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-csvkit +Version: 1.0.3 +Release: 0 +Summary: A library of utilities for working with CSV, the king of tabular file formats +License: MIT +Group: Development/Languages/Python +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} +BuildRequires: %{python_module aenum} +BuildRequires: %{python_module agate >= 1.6.1} +BuildRequires: %{python_module agate-excel >= 0.2.2} +BuildRequires: %{python_module agate-dbf >= 0.2.0} +BuildRequires: %{python_module agate-sql >= 0.5.3} +BuildRequires: %{python_module dbf >= 0.9.3} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module et_xmlfile} +BuildRequires: %{python_module jdcal} +BuildRequires: %{python_module openpyxl >= 2.2.0.b1} +BuildRequires: %{python_module python-dateutil >= 2.2} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six >= 1.6.1} +BuildRequires: %{python_module xlrd >= 0.9.2} +BuildRequires: fdupes +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 +BuildRequires: python-unittest2 >= 1.1.0 +# /SECTION +BuildArch: noarch + +%python_subpackages + +%description +CSVkit is a library of utilities for working with CSV, the king of tabular file +formats. It is inspired by pdftk, gdal and the original csvcut utility by Joe +Germuska and Aaron Bycoffe. + +%prep +%setup -q -n csvkit-%{version} +# find and remove unneeded shebangs +find csvkit -name "*.py" | xargs sed -i '1 {/^#!/ d}' + +%build +%python_build + +%install +%python_install +%python_expand %fdupes -s %{buildroot}%{$python_sitelib} + +%check +export LANG=en_US.UTF-8 +%python_expand nosetests-%{$python_bin_suffix} + +%files %python_files +%license COPYING +%doc AUTHORS.rst CHANGELOG.rst README.rst +%python3_only %{_bindir}/* +%{python_sitelib}/csvkit-%{version}-py*.egg-info +%{python_sitelib}/csvkit/ + +%changelog