csvw
Python library to work with CSVW described tabular data
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 csvwuv
uv add csvwpoetry
poetry add csvwInstalling 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
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
tableschemaValidates, infers, and works with tabular data…
permissive · top 15,000 on PyPI
tabulatorReads and writes tabular data in multiple…
permissive · top 15,000 on PyPI
dataflows-tabulatorReads and writes tabular data in multiple…
permissive · top 15,000 on PyPI
csvkitcsvkit provides command-line tools for…
permissive · top 15,000 on PyPI
frictionlessFrictionless provides a unified Python…
permissive · top 5,000 on PyPI
linear-tsvParses and writes tabular data in Linear TSV…
permissive · top 15,000 on PyPI
tablibTablib converts tabular data between multiple…
permissive · top 5,000 on PyPI
datapackageProvides classes and utilities to create, load,…
permissive · top 15,000 on PyPI
aiocsvProvides async-compatible CSV reading and…
permissive · top 5,000 on PyPI
pandas-schemaValidates pandas DataFrames against…
permissive · top 15,000 on PyPI