Skip to main content

askonce

Your pipeline or your model changed, and the CSV still parses. askonce tells you whether it still keeps the promises your first batch made.

askonce asks you a few questions about a folder of CSV files once: the form of each column, the keys, and which files refer to which. After that it checks every later batch against your answers, and gives one of three verdicts.

uvx askonce demo                 # real public data, about a second, nothing to set up
uvx askonce check ./out/         # your own folder: first time it asks, after that it checks
Exit Verdict Meaning
0 HOLDS every check held
1 VIOLATED a check you confirmed failed, with the file, line and value (this wins over NOT EVALUATED)
4 NOT EVALUATED nothing failed, but something could not be checked; it is never a pass
3 error askonce could not run; never a verdict

It is one Python file, standard library only, and it works offline. Status: alpha. It has been tested by its author on synthetic fixtures and on the public data below. There is no independent verification yet.

The demo

The data is South Africa's National Treasury eTenders, as published by the Open Contracting Partnership (public domain). There are four linked files: tenders, awards, suppliers and contracts.

1. First read of Jan to Jun 2026 (1,508 tenders, 369 awards, 61 contracts)
   askonce showed what it read and asked 5 questions; this demo answered yes to each.
   The contract now holds every column's form, the keys, and 7 references between files.

2. Jul to Sep 2026, as published: HOLDS

3. Jul to Sep 2026 again, with 3 changes planted to look like a different model re-extracting it:
   NOT EVALUATED: awards.csv, column 'value_amount' is blank on line 3; the first file had no blank there, so a person must say whether a blank is allowed
   VIOLATED: main.csv, column 'date', line 2 holds '03/07/2026', but the column was confirmed as date-times with a time zone (ISO 8601) by demo (answered yes to every question)
   VIOLATED: contracts.csv line 2: awardID '74332' is not among the id values in awards.csv
   VIOLATED: contracts.csv line 2: awardID '74332' is not among the awards_id values in awards_suppliers.csv
   Verdict: VIOLATED, exit code 1 (VIOLATED wins over NOT EVALUATED)

4. Receipt: /tmp/askonce-demo-…/.invar/receipts/receipt-….json
   Re-checked offline from the exact bytes: HOLDS (the receipt reproduces)
   Signed with a throwaway key made for this demo: signature verifies
   Changed one byte of awards.csv and re-checked: NOT EVALUATED (not the bytes the receipt names)

The three changes in step 3 are planted by the demo. They are not in the published data, which HOLDS.

On your own folder

uvx askonce check ./out/

The first time. askonce prints what it read in each file: whole numbers, money, dates, ISO 8601 date-times, codes or text. It also prints how many cells were blank, the keys it saw, and the references between files that held on every line. It asks once whether to hold later batches to them. Your answers are written to .invar/layout-contract.json, so keep that file in git.

Every later time. The same command checks the new batch against that contract, and writes a receipt to .invar/receipts/.

uvx askonce verify .invar/receipts/receipt-….json --in ./out/

This re-checks a receipt from the exact bytes, offline.

Blank cells. A blank in a checked column that had no blank in the first file is NOT EVALUATED, never a pass. In a terminal, askonce asks once whether a blank is allowed there, or is a mistake. With nobody there to answer, as in CI, it stays NOT EVALUATED, and the rest of the run is still reported. A changed byte, or a different contract, gives NOT EVALUATED, never a quiet pass. askonce sign adds a signature with your own SSH key.

In CI, fail the job on exit 1 and on exit 4.

With your coding agent

claude mcp add askonce -- uvx askonce mcp

The server is local, over stdio, and offers one tool, check_layout. The agent can check a folder, but it can never answer the first-read questions for you: a file nobody has confirmed comes back NOT EVALUATED. Its state lives in the folder the agent starts it in.

To have the agent run it after every step that writes data, paste docs/AGENTS-SNIPPET.md into your AGENTS.md or CLAUDE.md.

Without uv

curl -O https://raw.githubusercontent.com/Ramesh-35/askonce/main/askonce.py
python3 askonce.py check ./out/

Python 3.8 or later. The single file is the whole engine.

What it does not do yet

  • Date-time forms. A date-time with a space instead of T (2026-01-30 00:00:00) is read as text and not checked.
  • Formats. CSV only. There is no JSON or JSONL yet.
  • Text columns. Columns read as text are not checked, and that includes their blanks.
  • What it checks. It checks form, blanks, keys, arithmetic between columns and references between files. It does not check whether a value is true.
  • State across batches. Uniqueness is checked within a batch, not across batches.

Exit codes and receipts are a promise

The exit codes above will not change meaning. A receipt states:

  • the sha256 of every input file;
  • the sha256 of the contract;
  • the sha256 of the engine;
  • every finding.

Licence

MIT OR Apache-2.0. The demo data is under the ODC Public Domain Dedication and License; see src/askonce_kit/demo_data/SOURCE.md.

Found a wrong verdict? Please open an issue with the files, if you can share them. A wrong HOLDS is the bug that matters most.

Metadata

Release files for askonce 5.5.2

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

Source distribution (sdist)

Source distribution for askonce 5.5.2
File Size Uploaded Provenance Actions
askonce-5.5.2.tar.gz 161.1 kB Without provenance Details for askonce-5.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 310.9 kB

Release files / askonce-5.5.2.tar.gz

Download URL askonce-5.5.2.tar.gz
Size 161.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e6faa8a8bac5898f8c9dd9693dff025d3d5e0c77ebd973bf89aabc6094fff21a
BLAKE2b-256 checksum
How to use checksums
fa546bf8b360b14d0828b47030421d6289266662e414914d013888b894593950
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / askonce-5.5.2-py3-none-any.whl

Download URL askonce-5.5.2-py3-none-any.whl
Size 149.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa530c7d6a43748f153f42ffd6fca562230b3bf525469a632163f354b6f6070c
BLAKE2b-256 checksum
How to use checksums
4999f6f6a3d1dfa4bc56713f95c61a679ec74a2db1614c0462ac963eb15c90e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for askonce 5.5.2

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.

Release history Release notifications | RSS feed

This release

5.5.2 This release

2 release files No provenance

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