DEV Community

Cover image for A Tiny CSV Check Before Drafting a Business Explainer
Calpurnia Passmore
Calpurnia Passmore

Posted on

A Tiny CSV Check Before Drafting a Business Explainer

Research notes can look tidy while still hiding gaps. A document has a title but no date. A useful link appears twice under different labels. A number sits beside a quotation without any clue about the reporting period. For a business writer, those details become expensive when they surface halfway through a draft.

I would start with a small CSV file rather than a complicated research system. Give each row one source and keep a few columns: title, url, publication_date and note. The aim is modest. Make omissions visible before they become part of the story.

What should the script check?

Only what it can check honestly. An empty title is an empty title. A date that does not match the agreed format needs attention. Neither observation tells us whether a document is accurate or whether its author is independent.

Here is a small Python example. Save it as check_sources.py and run it with the path to your CSV file. It reads the file without changing it.

import csv
import sys
from datetime import date

with open(sys.argv[1], newline="", encoding="utf-8-sig") as source:
    for number, row in enumerate(csv.DictReader(source), start=2):
        issues = []
        for field in ("title", "url"):
            if not (row.get(field) or "").strip():
                issues.append(f"missing {field}")
        try:
            date.fromisoformat(row.get("publication_date") or "")
        except ValueError:
            issues.append("check publication_date")
        if issues:
            print(f"Row {number}: {', '.join(issues)}")
Enter fullscreen mode Exit fullscreen mode

Why keep the output so plain?

Because a warning should send me back to a source, not settle an editorial question. “Check publication_date” might mean I forgot to copy a date. It might also mean the document provides none. Those are different situations, and the script cannot decide which one applies.

The same caution matters when comparing businesses across countries. A date field does not reveal whether figures refer to a calendar year, a financial year or a quarter. I would keep that context in the note column and check it while reading the original document.

Illustration: organising research cards beside a laptop

What happens to a flagged row?

Give it an outcome. Correct the missing entry, record that the information is unavailable, or remove the source from a comparison that needs it. Leave a brief note explaining the choice. Otherwise, the same warning can appear every week without improving the underlying research.

I would keep private interview details in a separate protected record. A working CSV can travel far through shared folders and attachments. Use document references rather than copying sensitive contact information into every research table.

Where would I stop?

Before adding features that make the results look more authoritative than they are. Automatic summaries, quality scores and confident green ticks can hide uncertainty. A short list of incomplete rows is less impressive, but it gives a writer a clear next action.

The useful result is a calmer start to drafting. Open the file, run the check, resolve the obvious gaps, then return to the reporting. A little software can keep the desk organised while leaving the judgments with the person writing the story.

Top comments (0)