Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lemmy04
python-backports.csv
python-backports.csv.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python-backports.csv.spec of Package python-backports.csv
# # spec file for package python-backports.csv # # Copyright (c) 2019 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-backports.csv Version: 1.0.7 Release: 0 License: Python-2.0 Summary: Backport of Python 3 csv module Url: https://github.com/ryanhiebert/backports.csv Group: Development/Languages/Python Source: https://files.pythonhosted.org/packages/source/b/backports.csv/backports.csv-%{version}.tar.gz BuildRequires: python-rpm-macros BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildArch: noarch %python_subpackages %description ================================================ backports.csv: Backport of Python 3's csv module ================================================ .. image:: https://img.shields.io/pypi/v/backports.csv.svg :target: https://pypi.python.org/pypi/backports.csv :alt: Latest Version .. image:: https://travis-ci.org/ryanhiebert/backports.csv.svg?branch=master :target: https://travis-ci.org/ryanhiebert/backports.csv .. image:: https://badges.gitter.im/ryanhiebert/backports.csv.svg :alt: Join the chat at https://gitter.im/ryanhiebert/backports.csv :target: https://gitter.im/ryanhiebert/backports.csv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge .. image:: https://requires.io/github/ryanhiebert/backports.csv/requirements.svg?branch=master :target: https://requires.io/github/ryanhiebert/backports.csv/requirements/?branch=master :alt: Requirements Status The API of the csv module in Python 2 is drastically different from the csv module in Python 3. This is due, for the most part, to the difference between str in Python 2 and Python 3. The semantics of Python 3's version are more useful because they support unicode natively, while Python 2's csv does not. Installation ============ .. code-block:: sh pip install backports.csv Usage ===== First make sure you're starting your file off right: .. code-block:: python from backports import csv Then be careful with your files to handle the encoding. If you're working with a binary file-like object, ``io.TextIOWrapper`` can be very helpful. If you're dealing with a file, you can just use ``io.open`` instead of Python 2's ``open`` builtin, and it works just like Python 3's builtin ``open``. .. code-block:: python from backports import csv import io def read_csv(filename): with io.open(filename, newline='', encoding='utf-8') as f: for row in csv.reader(f): yield row def write_csv(filename, rows): with io.open(filename, 'w', newline='', encoding='utf-8') as f: writer = csv.writer(f) for row in rows: writer.writerow(row) Note: It should always be safe to specify ``newline=''``, since the csv module does its own (universal) newline handling. 1.0.7 (2019-03-10) ++++++++++++++++++ * Add tests to ``MANIFEST.in``. - thanks to @jayvdb for the pull request 1.0.6 (2018-05-22) ++++++++++++++++++ * Pass reader error messages along. (#28) This should help make errors more transparent. - thanks to @mpeteuil for the pull request 1.0.5 (2017-05-29) ++++++++++++++++++ * Fix bug in README example. (#22) - thanks to @tantale for the bug report * Allow ``None`` as quotechar when using ``QUOTE_NONE``. (#23) - thanks to @thanatos for the bug report 1.0.4 (2017-02-17) ++++++++++++++++++ * Return write value from writerow. (#20) - thanks to @therg 1.0.3 (2017-01-23) ++++++++++++++++++ * Add LICENSE file (#18). 1.0.2 (2016-09-15) ++++++++++++++++++ * Avoid quoting any numeric types when using ``QUOTE_NONNUMERIC``. - thanks to @torfsen for the bug report 1.0.1 (2016-02-11) ++++++++++++++++++ * Better error messages for invalid dialects. - thanks to @kengruven for the bug report 1.0 (2016-02-11) ++++++++++++++++ * Initial Release %prep %setup -q -n backports.csv-%{version} %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %python_exec setup.py test %files %{python_files} %doc LICENSE.rst README.rst %{python_sitelib}/* %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor