Catalog PyPI
PACKAGE EXPLORERView in registry

agentic-csv-cleaner

PyPI

Clean messy CSVs with an agentic workflow: an LLM decides the steps, tested code does the work.

ai-agentscsvdata-cleaningetlllmpandas
Versions collected1
Direct dependencies3From release 0.1.3
Last observed20 Oct, 22:14 UTC

README

Version 0.1.3 documentation

data-cleaner-agent

Clean a messy CSV with an agentic workflow. An LLM decides which cleaning steps the data needs, and tested Python functions do the actual work. The model plans the cleanup, it never touches your data values, so nothing gets hallucinated or silently rewritten.

Works offline out of the box (no API key). Can be driven by an LLM, and other AI agents can call it as an MCP tool.

Before / after

Full Name , Country, Signup Date, Amount Paid          full_name    country  signup_date  amount_paid
 Alice  ,Netherlands,2023-01-05,"€1.200,50"                Alice  Netherlands   2023-01-05       1200.5
Bob,nederland,05/01/2023,"$900"              ─────▶          Bob  Netherlands   2023-01-05        900.0
 Alice  ,NL,2023-01-05,"€1.200,50"                         Carol      Germany   2023-02-10       1000.0
Carol , Germany ,2023-02-10,1000                             Dan      Belgium   2023-03-01        750.0
Dan,belgie,2023/03/01,"€ 750,00"

In one pass it fixed the headers, trimmed whitespace, parsed three different date formats to ISO, turned €1.200,50 / $900 / € 750,00 into numbers, standardized the country names, and dropped the duplicate Alice row.

Install & run

pip install agentic-csv-cleaner

clean-csv messy.csv cleaned.csv       # clean a file
clean-csv messy.csv                   # or just print the result

No API key needed. The default planner is a set of offline heuristics.

The idea

An "agentic workflow" is just software with a few parts:

   look at the data   ->   planner picks the steps   ->   run the steps   ->   report
                           (rules, or an LLM)             (tested code)

The decision that makes it safe to trust:

The planner decides which tool runs on which column. The tools do the transformation. A language model is good at judgment ("this column looks like money") and bad at being a reliable calculator. So the LLM only ever picks operations from a fixed set. It never reads a value and writes back a "cleaned" one, which is where LLM data-cleaning usually goes wrong.

Two planners, one loop

PlannerWhat it isNeeds
RuleBasedPlannerOffline heuristics from a quick data profile. The default.nothing
LLMPlannerSends the profile + tool list to an LLM, gets back a JSON plan.pip install "agentic-csv-cleaner[llm]" + ANTHROPIC_API_KEY

Both return the same list of steps, so the loop is identical. You swap the brain, not the plumbing.

The log reports what each step actually did, including where a conversion could not produce a clean result (unparseable numbers/dates, unmapped categories), so a clean parse is distinguishable from a confident guess.

Use it from other code or agents

from cleaner.api import clean_csv_text

result = clean_csv_text(open("messy.csv").read())
print(result["cleaned_csv"])
print(result["steps"])

As an MCP tool

Other AI agents (Claude Desktop, or any MCP client) can call the cleaner as a tool, so they can clean a CSV properly instead of reformatting it token by token in the prompt:

pip install "agentic-csv-cleaner[mcp]"
python -m cleaner.mcp_server

This exposes one tool, clean_csv, that takes CSV text and returns the cleaned CSV plus the steps.

What's in the box

cleaner/tools.py holds the transformations: snake_case_headers, strip_whitespace, coerce_numeric, standardize_dates, standardize_categorical, drop_duplicate_rows.

Take standardize_dates. 2023-01-05 (year first, month in the middle) and 05/01/2023 (day first) need opposite parsing rules, and one global setting corrupts one or the other, so the tool decides per value. Mixed dates are genuinely ambiguous, and this handles them explicitly instead of guessing.

Tests

python -m unittest discover -s tests

License

MIT.

Downloads & popularity

10downloads
1-day window · source-reported counts19 Oct 2026
285142.50
2026-08-08: 285 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-08–2026-08-082026-08-09: 115 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-09–2026-08-092026-08-10: 19 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-10–2026-08-102026-08-11: 45 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-11–2026-08-112026-08-12: 6 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-12–2026-08-122026-08-14: 7 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-14–2026-08-142026-08-15: 12 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-15–2026-08-152026-08-16: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-16–2026-08-162026-08-17: 13 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-17–2026-08-172026-08-18: 20 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-18–2026-08-182026-08-19: 4 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-19–2026-08-192026-08-20: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-20–2026-08-202026-08-22: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-22–2026-08-222026-08-23: 7 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-23–2026-08-232026-08-24: 7 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-24–2026-08-242026-08-25: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-25–2026-08-252026-08-26: 2 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-26–2026-08-262026-08-27: 2 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-27–2026-08-272026-08-28: 12 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-28–2026-08-282026-08-29: 8 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-29–2026-08-292026-08-30: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-30–2026-08-302026-08-31: 2 · observed 2026-10-20T22:24:27.9312933Z · period 2026-08-31–2026-08-312026-09-01: 4 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-01–2026-09-012026-09-03: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-03–2026-09-032026-09-04: 11 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-04–2026-09-042026-09-05: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-05–2026-09-052026-09-06: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-06–2026-09-062026-09-07: 7 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-07–2026-09-072026-09-08: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-08–2026-09-082026-09-10: 3 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-10–2026-09-102026-09-11: 2 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-11–2026-09-112026-09-13: 9 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-13–2026-09-132026-09-14: 4 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-14–2026-09-142026-09-15: 3 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-15–2026-09-152026-09-16: 17 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-16–2026-09-162026-09-17: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-17–2026-09-172026-09-18: 3 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-18–2026-09-182026-09-19: 2 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-19–2026-09-192026-09-20: 15 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-20–2026-09-202026-09-21: 1 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-21–2026-09-212026-09-22: 4 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-22–2026-09-222026-09-23: 8 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-23–2026-09-232026-09-24: 3 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-24–2026-09-242026-09-25: 8 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-25–2026-09-252026-09-26: 16 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-26–2026-09-262026-09-27: 19 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-27–2026-09-272026-09-28: 15 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-28–2026-09-282026-09-29: 8 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-29–2026-09-292026-09-30: 12 · observed 2026-10-20T22:24:27.9312933Z · period 2026-09-30–2026-09-302026-10-01: 6 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-01–2026-10-012026-10-02: 8 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-02–2026-10-022026-10-03: 11 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-03–2026-10-032026-10-04: 14 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-04–2026-10-042026-10-05: 9 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-05–2026-10-052026-10-06: 15 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-06–2026-10-062026-10-07: 9 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-07–2026-10-072026-10-08: 6 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-08–2026-10-082026-10-09: 11 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-09–2026-10-092026-10-10: 21 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-10–2026-10-102026-10-11: 10 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-11–2026-10-112026-10-12: 9 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-12–2026-10-122026-10-13: 23 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-13–2026-10-132026-10-14: 13 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-14–2026-10-142026-10-15: 13 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-15–2026-10-152026-10-16: 6 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-16–2026-10-162026-10-17: 25 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-17–2026-10-172026-10-18: 14 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-18–2026-10-182026-10-19: 10 · observed 2026-10-20T22:24:27.9312933Z · period 2026-10-19–2026-10-19
8 Aug19 Oct

pypistats · 68 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-19102026-10-20T22:24:27.9312933Z
2026-10-18 – 2026-10-18142026-10-20T22:24:27.9312933Z
2026-10-17 – 2026-10-17252026-10-20T22:24:27.9312933Z
2026-10-16 – 2026-10-1662026-10-20T22:24:27.9312933Z
2026-10-15 – 2026-10-15132026-10-20T22:24:27.9312933Z
2026-10-14 – 2026-10-14132026-10-20T22:24:27.9312933Z
2026-10-13 – 2026-10-13232026-10-20T22:24:27.9312933Z
2026-10-12 – 2026-10-1292026-10-20T22:24:27.9312933Z
2026-10-11 – 2026-10-11102026-10-20T22:24:27.9312933Z
2026-10-10 – 2026-10-10212026-10-20T22:24:27.9312933Z
2026-10-09 – 2026-10-09112026-10-20T22:24:27.9312933Z
2026-10-08 – 2026-10-0862026-10-20T22:24:27.9312933Z
2026-10-07 – 2026-10-0792026-10-20T22:24:27.9312933Z
2026-10-06 – 2026-10-06152026-10-20T22:24:27.9312933Z
2026-10-05 – 2026-10-0592026-10-20T22:24:27.9312933Z
2026-10-04 – 2026-10-04142026-10-20T22:24:27.9312933Z
2026-10-03 – 2026-10-03112026-10-20T22:24:27.9312933Z
2026-10-02 – 2026-10-0282026-10-20T22:24:27.9312933Z
2026-10-01 – 2026-10-0162026-10-20T22:24:27.9312933Z
2026-09-30 – 2026-09-30122026-10-20T22:24:27.9312933Z
2026-09-29 – 2026-09-2982026-10-20T22:24:27.9312933Z
2026-09-28 – 2026-09-28152026-10-20T22:24:27.9312933Z
2026-09-27 – 2026-09-27192026-10-20T22:24:27.9312933Z
2026-09-26 – 2026-09-26162026-10-20T22:24:27.9312933Z
2026-09-25 – 2026-09-2582026-10-20T22:24:27.9312933Z
2026-09-24 – 2026-09-2432026-10-20T22:24:27.9312933Z
2026-09-23 – 2026-09-2382026-10-20T22:24:27.9312933Z
2026-09-22 – 2026-09-2242026-10-20T22:24:27.9312933Z
2026-09-21 – 2026-09-2112026-10-20T22:24:27.9312933Z
2026-09-20 – 2026-09-20152026-10-20T22:24:27.9312933Z
2026-09-19 – 2026-09-1922026-10-20T22:24:27.9312933Z
2026-09-18 – 2026-09-1832026-10-20T22:24:27.9312933Z
2026-09-17 – 2026-09-1712026-10-20T22:24:27.9312933Z
2026-09-16 – 2026-09-16172026-10-20T22:24:27.9312933Z
2026-09-15 – 2026-09-1532026-10-20T22:24:27.9312933Z
2026-09-14 – 2026-09-1442026-10-20T22:24:27.9312933Z
2026-09-13 – 2026-09-1392026-10-20T22:24:27.9312933Z
2026-09-11 – 2026-09-1122026-10-20T22:24:27.9312933Z
2026-09-10 – 2026-09-1032026-10-20T22:24:27.9312933Z
2026-09-08 – 2026-09-0812026-10-20T22:24:27.9312933Z
2026-09-07 – 2026-09-0772026-10-20T22:24:27.9312933Z
2026-09-06 – 2026-09-0612026-10-20T22:24:27.9312933Z
2026-09-05 – 2026-09-0512026-10-20T22:24:27.9312933Z
2026-09-04 – 2026-09-04112026-10-20T22:24:27.9312933Z
2026-09-03 – 2026-09-0312026-10-20T22:24:27.9312933Z
2026-09-01 – 2026-09-0142026-10-20T22:24:27.9312933Z
2026-08-31 – 2026-08-3122026-10-20T22:24:27.9312933Z
2026-08-30 – 2026-08-3012026-10-20T22:24:27.9312933Z
2026-08-29 – 2026-08-2982026-10-20T22:24:27.9312933Z
2026-08-28 – 2026-08-28122026-10-20T22:24:27.9312933Z
2026-08-27 – 2026-08-2722026-10-20T22:24:27.9312933Z
2026-08-26 – 2026-08-2622026-10-20T22:24:27.9312933Z
2026-08-25 – 2026-08-2512026-10-20T22:24:27.9312933Z
2026-08-24 – 2026-08-2472026-10-20T22:24:27.9312933Z
2026-08-23 – 2026-08-2372026-10-20T22:24:27.9312933Z
2026-08-22 – 2026-08-2212026-10-20T22:24:27.9312933Z
2026-08-20 – 2026-08-2012026-10-20T22:24:27.9312933Z
2026-08-19 – 2026-08-1942026-10-20T22:24:27.9312933Z
2026-08-18 – 2026-08-18202026-10-20T22:24:27.9312933Z
2026-08-17 – 2026-08-17132026-10-20T22:24:27.9312933Z
2026-08-16 – 2026-08-1612026-10-20T22:24:27.9312933Z
2026-08-15 – 2026-08-15122026-10-20T22:24:27.9312933Z
2026-08-14 – 2026-08-1472026-10-20T22:24:27.9312933Z
2026-08-12 – 2026-08-1262026-10-20T22:24:27.9312933Z
2026-08-11 – 2026-08-11452026-10-20T22:24:27.9312933Z
2026-08-10 – 2026-08-10192026-10-20T22:24:27.9312933Z
2026-08-09 – 2026-08-091152026-10-20T22:24:27.9312933Z
2026-08-08 – 2026-08-082852026-10-20T22:24:27.9312933Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.39 Aug 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
wesseltl/data-cleaner-agent

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:25ad0c7f5c543dddcd01353f6e29831435f4e7dba22e8f70242a44222e4afa07