Normalization#
from decimal import Decimal
from pipewhy.normalize.profiles import Profile
from pipewhy.normalize.records import encode_record
strict = encode_record([(0, Decimal("1.00")), (5, "e\u0301")])
logical = encode_record(
[(0, Decimal("1.00")), (5, "e\u0301")], profile=Profile.LOGICAL
)
Records return owned uint64 words and a full versioned profile identity. Strict representation is the default; the logical profile is opt-in. Persist the identity with the words: identical words under different profiles are not comparable. Field IDs define association; field delivery order does not affect encoding. The API accepts decoded typed scalars, so retain raw source bytes when file syntax or encoding identity matters. Unsupported types and overflow raise explicit errors.
See blueprint/NORMALIZATION_CONTRACT.txt for the wire format and supported types.
tests/fixtures/normalization_v1.json contains independent portable golden vectors;
64-bit expected words use decimal strings to avoid JSON number precision loss.