skillfed

csvw

Python library to work with CSVW described tabular data

csvw v4.1.0 1.4M downloads/30d#3,896 on PyPI51
Permissive license Apache 2.0 Active released

What it is and what it does

csvw is a Python library implementing the W3C CSV on the Web specification for reading, writing, and validating tabular data with structured metadata. It provides both a programmatic API for working with CSVW-described datasets and command-line tools (csvw2json, csvwvalidate, csvwdescribe) for common operations. The package handles CSV files with associated JSON metadata that describe table schemas, dialects, and data types, enabling structured interchange of tabular data with semantic meaning.

The library passes 269 of 270 JSON tests and 280 of 282 validation tests from the W3C CSVW test suite, making it suitable for production use. It also bridges Frictionless Data specifications, allowing conversion between CSVW metadata and Data Package formats. Known limitations include UTF-8 BOM handling, CSV dialect edge cases with comment prefixes, and some escapechar round-tripping issues inherited from Python's standard csv module.

Use it for:

  • Convert CSV files to JSON with full schema validation and type coercion using CSVW metadata
  • Validate CSV datasets against W3C CSVW specifications before processing or publishing
  • Generate CSVW metadata descriptors for raw CSV files with automatic schema inference
  • Migrate tabular data between Frictionless Data packages and W3C CSVW formats
  • Parse and read CSV files with complex, multi-table schemas and type constraints

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Reads, writes, and validates tabular data according to the CSV on the Web (CSVW) specification, with both a Python API and command-line tools for conversion and validation.

Yes. csvw is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively. Install it if you need to work with W3C CSVW-described data, validate CSV against formal schemas, or bridge Frictionless Data and CSVW ecosystems. The 4.x API is not backward compatible with earlier versions, so verify your use case aligns with the current API before upgrading existing code.

Install

csvw on PyPI

pip

pip install csvw

uv

uv add csvw

poetry

poetry add csvw

Installing csvw

Before you install

Low friction install with 9 runtime dependencies. Actively maintained with a release 39 days ago and recent commits. Supports Python 3.9 through 3.14 on both CPython and PyPy.

License in practice

Distributed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions beyond attribution.

Quickstart

pip install csvw

from csvw import CSVW
import json
data = CSVW('https://raw.githubusercontent.com/cldf/csvw/master/tests/fixtures/test.tsv')
print(json.dumps(data.to_json(minimal=True), indent=4))

Requires Python >=3.9

Verify before relying

  • Whether the 4.x API breaking changes affect your existing codebase (changelog referenced but not provided)
  • Performance characteristics with large CSV files or complex schemas
  • Full extent of Frictionless Data compatibility beyond conversion methods shown

Package facts

License Apache 2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 9 — isodate, python-dateutil, rfc3986, uritemplate, babel, language-tags, rdflib, termcolor, jsonschema
Maintenance actively maintained — 39 days since the last release
Last repo commit
First released
Downloads 1,438,346/month — #3,896 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: csvw-4.1.0-py2.py3-none-any.whl

Keywords: csv, w3c, tabular-data

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

csv on the webcsvw validationtabular data metadatacsv to json conversionw3c csv standardstructured csv parsingcsv schema validation
w3c-standarddata-validationtabular-data

More Text Processing packages