Download icon
Script icon
Process icon
If icon
ArchiveDecompress icon
Loop icon
CsvToIon icon
Write icon
Fail icon
Schedule icon

Validate ZIP Archives Before Importing CSV Files

Gate ZIP-to-CSV ingestion with path checks, byte budgets, CRC verification, and optional SHA-256; export ION files and an audit manifest.

Categories
Data

Inspect vendor ZIP drops before extraction, retaining an audit report when paths, integrity checks, or expansion budgets fail. Convert selected CSVs only after every archive member passes the gate.

How it works

  1. Download a ZIP with retries. The disabled daily schedule uses input defaults.
  2. Python checks a trusted SHA-256 if supplied, entry paths/types, counts, sizes, compression ratios, local/index agreement, and CRCs. Bounded raw inflation counts actual bytes without writing archive members to disk.
  3. If fails rejected executions with a downloadable inspection report.
  4. ArchiveDecompress extracts accepted ZIPs. Loop converts selected CSVs to ION two at a time, exporting filenames, storage URIs, and row counts.
  5. manifest publishes those results only when every conversion succeeds.

What you get

  • report.json for accepted and policy-rejected archives.
  • ION files and a JSON manifest with converted[].outputs mappings.
  • All-member inspection, even when csv_glob selects a subset for conversion.

Who it's for

Data engineers importing recurring CSV bundles from vendors.

Why orchestrate this with Kestra

Retries, inspection, extraction, bounded conversions, and publication are separately observable Kestra tasks.

Prerequisites

Kestra 2.0 with Python, Compress, and Serdes plugins; Python 3.11+ and uv on the Process-runner worker; access to a trusted HTTP(S) source. Selected CSVs must have UTF-8 encoding, comma delimiters, and a single header row. ZIPs must use conventional stored/DEFLATE records without ZIP64, encryption, links, or Unicode path overrides. Every member counts toward byte budgets. The archive-size check runs AFTER download; also apply worker disk/memory quotas and outbound controls. This checks ingestion policy, not malware.

Secrets

None for the sample. Configure download authentication for private sources. Obtain expected_sha256 through a trusted channel when using that check.

Quick start

  1. Import the flow without its catalog-only extend block and execute defaults: inspect a pinned seaborn-data ZIP and convert its 150-row iris.csv.
  2. Download inspect > report.json and manifest > uri.
  3. Set max_entries to 1: the run fails without executing extract.
  4. Set your source and limits. csv_glob matches full paths, case-sensitively; use *.csv for all lowercase CSV filenames. Malformed CSVs fail conversion without a manifest. Test manually before enabling daily (06:00 UTC).

How to extend

Load the manifest's ION files into a warehouse, or replace HTTP with an object-storage download while preserving the accepted-branch dependency.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.