Skip to main content

clean your CSVs!

This command line tool cleans CSV files by:

  1. converting encoding to utf-8
  2. detecting the delimiter and safely converting it to a comma
  3. casting all variables to json form, i.e. integers, floats, booleans, string or null.
  • install pip install csv-bleach
  • and run like python -m csv_bleach my-data.csv

The only option is the output file name, by default it will be your original file name with .scsv extension.

You will now be able to parse your CSV safely with a simple script like:

import json


def parse_row(text):
    return json.loads(f"[{text}]")

def parse_file(file):
    rows = map(parse_row, file)
    header = next(rows)
    for row in rows:
        yield dict(zip(header, row))


with open("my-data.scsv") as f:
    for item in parse_file(f):
        print(item)

Metadata

Release files for csv_bleach 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csv_bleach 2.4.0
File Size Uploaded Provenance
csv_bleach-2.4.0.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for csv_bleach 2.4.0
File Interpreter ABI Platform
csv_bleach-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / csv_bleach-2.4.0.tar.gz

Download URL csv_bleach-2.4.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
671a2be98925ea08bb3de0656283a8b5c33524fc7a28b6088228d29fcc72ca08
BLAKE2b-256 checksum
How to use checksums
38cbd31492cc98f56492798e390ab003c68457156064e33a2ff916a470a597b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

Release files / csv_bleach-2.4.0-py3-none-any.whl

Download URL csv_bleach-2.4.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff2307c0d14ab9da793ec2f343ca94685ed810f874a815d8b94363426f859296
BLAKE2b-256 checksum
How to use checksums
4daebeaf3330912c38372ffacd55ed3264147fbd79dbd54cfc1caaa9f1f63b40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

Security for csv_bleach 2.4.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page