Library / Code module
Record entry validator with normalization rules
record_entry_validator
Check rows of records (CSV or objects) against declared field rules for type, required, allowed values, pattern, bounds, length and unique keys, after normalizing case, spaces, digits and dates, and list each error by row.
ATTRIBUTION.md4.9 KBLICENSE1.0 KBONET-ATTRIBUTION.md6.8 KBPROCEDURE.md2.8 KBREADME.md5.2 KBTOOLS.md2.1 KBcomponent.json12.6 KBexamples/known_good.json4.1 KBexamples/known_wrong.json366 byteskit_schema.py11.4 KBrecord_entry_validator.py12.2 KBtest_package.py6.8 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Command
python3 record_entry_validator.py < input.json- Function
record_entry_validator.run- Required input
- fields
Cases it covers
- Known wrong example: The rules require customer_id but the CSV has no customer_id column at all, which is a structural problem rather than a row error. Refused as missing required column.
- input invalid: refused with exit code 2
- input not json: refused with exit code 2
- header missing: refused with exit code 2
- duplicate field rule: refused with exit code 2
- invalid pattern: refused with exit code 2
- missing required column: refused with exit code 2
- unknown unique field: refused with exit code 2
Limits and scope
- Limits
- Email and phone checks are format checks only; they do not prove an address or number exists. Title case lowercases the rest of each word, so names such as McDonald need a correction list afterwards. Date parsing uses the formats given, so 03/04/2026 is read by the first format that fits. Values are treated as text; numbers with thousands separators fail the number check.
- Work activities
- Enter information into databases or software programs; Maintain data in information systems or databases; Update computer database information.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/occupation_task_kits/items/record_entry_validator
- Size
- 12 files, 70.1 KB
- Identity
library.supply.creative_originals.99bd6dbb60428ae52b7d5020.c7330118274c12ec- Version
c7330118274c12ec7f1a070aa26e82371f261769a31880ace4be42c86196dbd9
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- CSV files and recordsCorner cases
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.