Skip to main content

No project description provided

Project description

csvw

Build Status codecov Requirements Status PyPI

CSV on the Web

Links

Installation

This package runs under Python 2.7, and 3.4+, use pip to install:

$ pip install csvw

Example

>>> 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. Thus, if such data starts with U+FEFF this will be interpreted as BOM 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

License

This package is distributed under the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csvw-1.4.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csvw-1.4.0-py2.py3-none-any.whl (25.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file csvw-1.4.0.tar.gz.

File metadata

  • Download URL: csvw-1.4.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for csvw-1.4.0.tar.gz
Algorithm Hash digest
SHA256 45b8f950970faa2fde25d1e063c4f670a11029ee71a0af1a8e2bb1c2827a3f01
MD5 9f6f5d3b83b4560116fb512fbdb5951f
BLAKE2b-256 bc8942b5688778f97794a4bdd09821b50d441622194d07e4135f86615c7f5e21

See more details on using hashes here.

File details

Details for the file csvw-1.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: csvw-1.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for csvw-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 89c185d2126c9ed3179e9576521f090fc8945de4fc2d719b386af0373665afc0
MD5 d51ef0c5aeb7d2ee4416a7129729ffe8
BLAKE2b-256 6779b3a415ae7121b724e1375b796e9814dc3f860b1bc5467cdb2625f67c7209

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page