Three small, safety-focused Python automations built with the standard library. Every example uses fictional data, includes automated tests, and documents its limits.
Cleans headers and whitespace, removes case-insensitive duplicate rows, writes a clean CSV, and generates a JSON quality report.
$ python projects/csv_cleanup/automate_csv.py projects/csv_cleanup/sample_input.csv --output cleaned.csv --report report.json
{
"input_rows": 4,
"output_rows": 3,
"duplicates_removed": 1,
"blank_cells_by_column": {"Record ID": 1}
}
Quick start:
cd projects/csv_cleanup
python automate_csv.py sample_input.csv --output cleaned.csv --report report.json
python -m unittest -vLimits: CSV only; full-row deduplication; memory usage grows with the input; no schema inference or Excel formatting.
Plans deterministic batch renames with dry-run as the default, writes a CSV or JSON manifest, rejects collisions, and can undo applied operations. It never deletes files.
$ python batch_rename.py demo_files --prefix holiday --manifest rename_manifest.json
{
"mode": "dry-run",
"operations": [
{"source": "Family Holiday 01.JPG", "target": "holiday_001.jpg", "status": "planned"}
]
}
Quick start on Windows:
cd projects\safe_file_renamer
python batch_rename.py demo_files --prefix holiday --manifest rename_manifest.json
# Review the manifest before explicitly applying:
python batch_rename.py demo_files --prefix holiday --manifest rename_manifest.json --apply
python batch_rename.py --undo rename_manifest.json --apply
python -m unittest -vLimits: one directory at a time; no deletion or overwrite; undo requires the original manifest and files to remain at their expected paths; keep an independent backup.
Compares EN/PT-BR technical files and reports missing or changed placeholders, URLs, Markdown code, HTML/XML tags, localization keys, and empty target segments. Produces text and JSON reports with automation-friendly exit codes.
$ python translation_qa.py samples/strings.en.json samples/strings.pt-BR.json
Translation QA report
=====================
Status: PASS | Errors: 0 | Warnings: 0
No structural QA issues found.
Quick start:
cd projects/translation_qa
python translation_qa.py samples/README.en.md samples/README.pt-BR.md
python translation_qa.py samples/strings.en.json samples/strings.pt-BR.json
python -m unittest -vLimits: structural QA does not prove linguistic accuracy; YAML support is intentionally limited to mapping-style localization files; complex ICU messages still require human review.
Each project is dependency-free and tested separately:
python -m unittest discover -s projects/csv_cleanup -p "test_*.py" -v
python -m unittest discover -s projects/safe_file_renamer -p "test_*.py" -v
python -m unittest discover -s projects/translation_qa -p "test_*.py" -vThe repository contains only authored demonstration code and fictional sample data. It contains no customer files, credentials, local manifests, personal email addresses, tokens, or marketplace-specific copy.
Code in this repository is available under the MIT License. Sample text and data are original demonstration material included with the repository.