FieldSpec#
- class scikitplot.cleanprompt.FieldSpec(names, kind, role='field', suffix=True, span='line')[source]#
A field whose value is sensitive wherever it appears in a record.
- Parameters:
- namestuple of str
Normalised names that identify the field.
- kindstr
The kind its values are recorded under.
- rolestr
The schema role a column of this name carries, for the role-preserving stand-ins of notebooks and modules.
- suffixbool, default=True
Whether a key that ends with one of the names also matches, so that
billing_phoneis aphone. Off for names too generic to trust as a suffix:statewould otherwise matchloading_state.- span{‘line’, ‘clause’, ‘token’}, default=’line’
How far a value runs in prose (
Key: valuein running text).linehides to the end of the line — right for names, addresses, diagnoses and dates, which may contain a comma.clausestops at the first comma or semicolon — right for identifiers whose format never contains one but may contain spaces (a telephone number).tokenstops at the first whitespace — right only for identifiers whose format contains neither, so thatMRN: 00412345 for ann@example.comhides the number as an MRN and leaves the address to the email rule. Choose by the identifier’s format; when in doubt,linehides more and never less. Structured formats are unaffected: a CSV cell or a JSON value is always the whole value.
- Parameters: