From d299b308ffa759db50eb8bac41c7c6ebaf5cd6bd Mon Sep 17 00:00:00 2001 From: xrotwang Date: Wed, 1 Aug 2018 11:14:12 +0200 Subject: [PATCH] release 1.4.0 --- CHANGES | 6 +++ README.md | 76 ++++++++++++++++++++++++++++++++++ README.rst | 99 -------------------------------------------- RELEASING.md | 5 ++- setup.py | 10 ++--- src/csvw/__init__.py | 2 +- 6 files changed, 90 insertions(+), 108 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/CHANGES b/CHANGES index 5ed90fa..33d7ee8 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,12 @@ Version 2.0 (in development) - Ignore and deprecate the data argument of TableGroup.check_referential_integrity. +Version 1.4 +----------- + +- Read all data with encoding specified as UTF-8 using utf-8-sig encoding. + + Version 1.0 ----------- diff --git a/README.md b/README.md new file mode 100644 index 0000000..daea9b2 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# csvw + +[![Build Status](https://travis-ci.org/cldf/csvw.svg?branch=master)](https://travis-ci.org/cldf/csvw) +[![codecov](https://codecov.io/gh/cldf/csvw/branch/master/graph/badge.svg)](https://codecov.io/gh/cldf/csvw) +[![Requirements Status](https://requires.io/github/cldf/csvw/requirements.svg?branch=master)](https://requires.io/github/cldf/csvw/requirements/?branch=master) +[![PyPI](https://img.shields.io/pypi/v/csvw.svg)](https://pypi.org/project/csvw) + + +CSV on the Web + + + +## Links + +- GitHub: https://github.com/cldf/csvw +- PyPI: https://pypi.org/project/csvw +- Issue Tracker: https://github.com/cldf/csvw/issues + + +## Installation + +This package runs under Python 2.7, and 3.4+, use pip to install: + +```bash +$ pip install csvw +``` + + +## Example + + +```python +>>> import csvw +>>> tg = csvw.TableGroup.from_file('tests/csv.txt-metadata.json') + +>>> tg.check_referential_integrity() +>>> assert len(tg.tables) == 1 + +>>> assert tg.tables[0] is tg.tabledict['csv.txt'] +>>> tg.tables[0].check_primary_key() + +>>> from collections import OrderedDict +>>> row = next(tg.tables[0].iterdicts()) +>>> assert row == OrderedDict([('ID', 'first'), ('_col.2', 'line')]) + +>>> assert len(list(tg.tables[0].iterdicts())) == 2 +``` + + +## Known limitations + +- We read **all** data which is specified as UTF-8 encoded using the + [`utf-8-sig` codecs](https://docs.python.org/3/library/codecs.html#module-encodings.utf_8_sig). + Thus, if such data starts with `U+FEFF` this will be interpreted as [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) + and skipped. +- Low level CSV parsing is delegated to the `csv` module in Python's standard library. Thus, if a `commentPrefix` + is specified in a `Dialect` instance, this will lead to skipping rows where the first value starts + with `commentPrefix`, even if the value was quoted. + + +## See also + +- https://www.w3.org/2013/csvw/wiki/Main_Page +- https://github.com/CLARIAH/COW +- https://github.com/CLARIAH/ruminator +- https://github.com/bloomberg/pycsvw +- https://github.com/frictionlessdata/goodtables-py +- https://github.com/frictionlessdata/tableschema-py +- https://github.com/theodi/csvlint.rb +- https://github.com/ruby-rdf/rdf-tabular +- https://github.com/rdf-ext/rdf-parser-csvw + + +## License + +This package is distributed under the [Apache 2.0 license](https://opensource.org/licenses/Apache-2.0). diff --git a/README.rst b/README.rst deleted file mode 100644 index 5f0e915..0000000 --- a/README.rst +++ /dev/null @@ -1,99 +0,0 @@ -Csvw -==== - -|PyPI version| |License| |Supported Python| |Format| |requires| - -|Travis| |codecov| - -CSV on the web - - -Links ------ - -- GitHub: https://github.com/cldf/csvw -- PyPI: https://pypi.python.org/pypi/csvw -- Issue Tracker: https://github.com/cldf/csvw/issues -- Download: https://pypi.python.org/pypi/csvw#downloads - - -Installation ------------- - -This package runs under Python 2.7, and 3.4+, use pip_ to install: - -.. code:: bash - - $ pip install csvw - - -Example -------- - -.. code:: python - - >>> import csvw - >>> tg = csvw.TableGroup.from_file('tests/csv.txt-metadata.json') - - >>> tg.check_referential_integrity() - >>> assert len(tg.tables) == 1 - - >>> assert tg.tables[0] is tg.tabledict['csv.txt'] - >>> tg.tables[0].check_primary_key() - - >>> from collections import OrderedDict - >>> row = next(tg.tables[0].iterdicts()) - >>> assert row == OrderedDict([('ID', 'first'), ('_col.2', 'line')]) - - >>> assert len(list(tg.tables[0].iterdicts())) == 2 - - -See also --------- - -- https://www.w3.org/2013/csvw/wiki/Main_Page -- https://github.com/CLARIAH/COW -- https://github.com/CLARIAH/ruminator -- https://github.com/bloomberg/pycsvw -- https://github.com/frictionlessdata/goodtables-py -- https://github.com/frictionlessdata/tableschema-py -- https://github.com/theodi/csvlint.rb -- https://github.com/ruby-rdf/rdf-tabular -- https://github.com/rdf-ext/rdf-parser-csvw - - -License -------- - -This package is distributed under the `Apache 2.0 license`_. - - -.. _pip: https://pip.readthedocs.io - -.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0 - - -.. |--| unicode:: U+2013 - - -.. |PyPI version| image:: https://img.shields.io/pypi/v/csvw.svg - :target: https://pypi.python.org/pypi/csvw - :alt: Latest PyPI Version -.. |License| image:: https://img.shields.io/pypi/l/csvw.svg - :target: https://pypi.python.org/pypi/csvw - :alt: License -.. |Supported Python| image:: https://img.shields.io/pypi/pyversions/csvw.svg - :target: https://pypi.python.org/pypi/csvw - :alt: Supported Python Versions -.. |Format| image:: https://img.shields.io/pypi/format/csvw.svg - :target: https://pypi.python.org/pypi/csvw - :alt: Format -.. |Travis| image:: https://img.shields.io/travis/cldf/csvw.svg - :target: https://travis-ci.org/cldf/csvw - :alt: Travis -.. |requires| image:: https://requires.io/github/cldf/csvw/requirements.svg?branch=master - :target: https://requires.io/github/cldf/csvw/requirements/?branch=master - :alt: Requirements Status -.. |codecov| image:: https://codecov.io/gh/cldf/csvw/branch/master/graph/badge.svg - :target: https://codecov.io/gh/cldf/csvw - diff --git a/RELEASING.md b/RELEASING.md index 434f0a5..4494b16 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -29,7 +29,10 @@ git tag -a v -m" release" - Release to PyPI: ```shell rm dist/* -python setup.py sdist bdist_wheel +python setup.py sdist +twine upload dist/* +rm dist/* +python setup.py bdist_wheel twine upload dist/* ``` diff --git a/setup.py b/setup.py index e428688..3ce0e70 100644 --- a/setup.py +++ b/setup.py @@ -3,18 +3,14 @@ from setuptools import setup, find_packages -def read(fname): - with open(fname) as fp: - return fp.read() - - setup( name='csvw', - version='1.3.1.dev0', + version='1.4.0', author='Robert Forkel', author_email='forkel@shh.mpg.de', description='', - long_description=read('README.rst'), + long_description=open('README.md').read(), + long_description_content_type='text/markdown', keywords='csv w3c', license='Apache 2.0', url='https://github.com/cldf/csvw', diff --git a/src/csvw/__init__.py b/src/csvw/__init__.py index 9d3b7aa..208f239 100644 --- a/src/csvw/__init__.py +++ b/src/csvw/__init__.py @@ -20,7 +20,7 @@ ] __title__ = 'csvw' -__version__ = '1.3.1.dev0' +__version__ = '1.4.0' __author__ = 'Robert Forkel' __license__ = 'Apache 2.0, see LICENSE' __copyright__ = 'Copyright (c) 2018 Robert Forkel'