This project has been quarantined by PyPI admins. It cannot be installed or modified until a security review is complete.
modern-csv
A zero-dependency Python CLI tool that audits CSV files for structure, encoding, duplication, and data-formatting issues and generates a clean Markdown (.md) error report.
Use --tags to extract only the specific error types or categories you care about, or run all checks at once.
Installation
pip install modern-csv
Or install locally in editable mode during development:
pip install -e .
Quick Start
# Audit all 11 checks and write data_errors.md next to data.csv
modern-csv data.csv
# Choose a custom output path (or '-' to print to stdout)
modern-csv data.csv -o reports/audit.md
modern-csv data.csv -o -
# Run specific check tags
modern-csv data.csv --tags encoding,delimiters,nulls
# Run an entire category
modern-csv data.csv --tags structure
modern-csv data.csv --tags formatting
# Specify primary key column(s) (supports composite keys with '+')
modern-csv data.csv --tags duplicate-keys --key id --key email
modern-csv data.csv --tags duplicate-keys --key org_id+user_id
# Short alias & CI mode (exit code 1 if issues are found)
mcsv data.csv --tags all --only-errors --fail-on-error
# List all supported tags
modern-csv --list-tags
Supported Tags
| Category Tag | Check Tag | Issue Detected |
|---|---|---|
structure |
encoding |
File Encoding Mismatches — invalid UTF-8 byte sequences, BOM markers, mojibake, U+FFFD replacement characters, mixed CRLF/LF line endings |
structure |
delimiters |
Inconsistent Delimiters — rows with missing or competing unquoted delimiters (,, ;, \t, |) |
structure |
columns |
Uneven Column Counts — rows with fewer or more columns than the header row |
structure |
empty-rows |
Empty Rows & Repeated Headers — blank/whitespace-only rows and header rows repeated inside data |
missing-duplicates (alias: duplicates) |
nulls |
Null & Missing Values — empty cells and null placeholders (NULL, N/A, NaN, None, -, ?, etc.) with per-column counts |
missing-duplicates |
duplicate-rows |
Exact Duplicate Rows — identical rows appearing more than once |
missing-duplicates |
duplicate-keys |
Duplicate Primary Keys / Unique Identifiers — duplicate values in --key columns or auto-detected ID columns (id, *_id, uuid, email, sku, etc.) |
formatting (alias: types) |
numeric-text |
Numbers Stored as Text — currency ($1,200.50), comma-grouped numbers, percentages, leading apostrophes ('123), and stray text in numeric columns |
formatting |
dates |
Inconsistent Date Formats — mixed date formats in the same column (YYYY-MM-DD, MM/DD/YYYY, DD/MM/YYYY, DD-Mon-YYYY, etc.) and invalid calendar dates |
formatting |
whitespace-case |
Leading/Trailing Whitespace & Case Inconsistency — untrimmed cells/headers and columns with inconsistent casing (e.g., Active vs active) |
formatting |
hidden-chars |
Hidden Characters & Embedded Newlines — zero-width spaces, non-breaking spaces, control characters, and embedded \n/\r inside quoted fields |
Use --tags all (the default) to run every check.
Python API
from modern_csv import AuditOptions, audit_csv, render_markdown
report = audit_csv("data.csv", AuditOptions(tags=("structure", "nulls"), key_columns=("id",)))
markdown = render_markdown(report, max_samples=50)
print(markdown)
Publishing to PyPI
- Update
name,authors, and[project.urls]inpyproject.toml. - Build the distribution artifacts:
python -m pip install build twine python -m build
- Upload to TestPyPI or PyPI:
python -m twine upload --repository testpypi dist/* python -m twine upload dist/*
License
MIT
Metadata
Release files for modern-csv 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| modern_csv-0.1.0.tar.gz | 26.7 kB | Without provenance | Details for modern_csv-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| modern_csv-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for modern_csv-0.1.0-py3-none-any.whl |
Total release size: 54.2 kB
Release files / modern_csv-0.1.0.tar.gz
| Download URL | modern_csv-0.1.0.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fb3600dc2955165d534fdc2962be803facb0845c3fddd8e776f2cb94c8c3c7e
|
|
BLAKE2b-256 checksum How to use checksums |
f84448a71df533d97607f80dc066a055755c7b0345e2a2f7ffbc48302a0b3b78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / modern_csv-0.1.0-py3-none-any.whl
| Download URL | modern_csv-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17272628d55b13c1ddfc28c00155178044002fdfecae9be0dfabf63dc6f8627b
|
|
BLAKE2b-256 checksum How to use checksums |
6327bc6e8cefe19ddcfdaccf9d7315c6a4bde86fb05e1009a2b2a49151ccccf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for modern-csv 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.