Profile reference¶
A profile is a TOML file that tells pakad how to read the two inputs, how to match records, and which checks to run. Print a commented starting point with pakad example-profile.
Validation is strict. A setting pakad does not recognize is an error, so a typo can never silently switch a check off. Check a profile with pakad check-profile. A profile must be a regular file of at most 1 MiB; a pipe or device is refused.
Complete example¶
version = 1
name = "HR roster vs directory export"
[expected]
key = ["employee_id"]
[collected]
key = ["employeeID"]
[match]
normalize = ["strip", "casefold"]
[[compare]]
expected = "status"
collected = "accountEnabled"
normalize = ["strip", "casefold"]
equivalents = { "true" = "active", "false" = "terminated" }
[collection]
source_column = "domain"
expected_sources = ["corp.example", "eu.corp.example", "apac.corp.example"]
captured_at_column = "collectedAt"
max_age_hours = 24
naive_timestamps = "reject"
page_sizes = [1000, 1500, 5000]
Top level¶
Setting |
Required |
Meaning |
|---|---|---|
|
Yes |
Profile format version. Must be the whole number |
|
No |
Shown in report titles. Default: |
[expected] and [collected]¶
Both tables take the same settings and both are required.
Setting |
Default |
Meaning |
|---|---|---|
|
required |
Column, or list of columns, that identify a record. Both tables must name the same number of columns. The first expected column is matched with the first collected column, and so on. |
|
|
|
|
|
CSV delimiter, one character other than a quote or line break. Files ending in |
|
|
Text encoding. The default reads UTF-8 with or without a byte order mark. Use, for example, |
[match]¶
Setting |
Default |
Meaning |
|---|---|---|
|
|
Steps applied to key values before matching, in the order listed. |
Available normalization steps:
Step |
Effect |
|---|---|
|
Applies Unicode NFKC normalization, so look-alike forms such as full-width digits compare as plain digits. |
|
Removes spaces, tabs, and line breaks at the start and end. |
|
Turns every run of whitespace inside the value into one space. |
|
Ignores letter case, including for non-English letters. |
The steps run exactly in the order you list them, and the order changes the result. Put nfkc first. NFKC can create new capital letters, new spaces, and new leading or trailing whitespace, so a later casefold or strip cleans up what it made, while an earlier one does not. For example, with ["casefold", "nfkc"] the letters U+03D2 and U+03A5 become different keys (Υ and υ), and with ["nfkc", "casefold"] they match. The report’s rules list the steps in the order they ran.
Choose steps deliberately. If two different raw keys become identical after normalization, pakad reports an ambiguous-key finding rather than silently merging them.
[[compare]]¶
Optional. Repeat the table once for each field to compare on matched records.
Setting |
Default |
Meaning |
|---|---|---|
|
required |
Column in the expected input. |
|
required |
Column in the collected input. |
|
|
Steps applied to both values before comparing. |
|
none |
Table mapping a collected value to the expected value it counts as. The mapping adds an accepted form and runs one way, from collected to expected: a collected value equal to the expected value always matches, and the expected value is never mapped. Keys and values are normalized with the same steps, and two keys that normalize to the same text are an error. |
An absent value never equals anything, including another absent value, so missing data always shows up as a field-mismatch.
A profile with no [[compare]] section compares only key presence, and the report lists “field comparison” under Not verified, so a run that compared no fields is never read as a full pass. Fields are compared only when each side has exactly one record for the key. When duplicates make the pairing unclear, pakad skips the comparison for that key and says so under Not verified.
[collection]¶
Optional checks on the collected export as a whole.
Setting |
Default |
Meaning |
|---|---|---|
|
none |
Collected column that names where each record came from, for example its domain. |
|
none |
Sources that must each contribute at least one record. Needs |
|
none |
Collected column holding each record’s capture time, in ISO 8601. Set together with |
|
none |
Records captured longer ago than this, measured from the reference time, are reported as stale. Between 0 and 87600 (ten years). Capture times more than five minutes after the reference time are reported as invalid, because they usually mean a clock or typing error. |
|
|
How to treat capture times without a time zone: |
|
|
Warn when the collected record count, overall or for any source, is an exact multiple of one of these numbers. Use |
Checks that are not configured are listed under Not verified in every report, so a reader can see what was not checked. That includes field comparison: a profile with no [[compare]] fields compares only that each key exists, and the report says so.