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_phone is a phone. Off for names too generic to trust as a suffix: state would otherwise match loading_state.

span{‘line’, ‘clause’, ‘token’}, default=’line’

How far a value runs in prose (Key: value in running text). line hides to the end of the line — right for names, addresses, diagnoses and dates, which may contain a comma. clause stops at the first comma or semicolon — right for identifiers whose format never contains one but may contain spaces (a telephone number). token stops at the first whitespace — right only for identifiers whose format contains neither, so that MRN: 00412345 for ann@example.com hides the number as an MRN and leaves the address to the email rule. Choose by the identifier’s format; when in doubt, line hides more and never less. Structured formats are unaffected: a CSV cell or a JSON value is always the whole value.

Parameters:
kind: str[source]#
names: tuple[str, ...][source]#
role: str = 'field'#
span: str = 'line'#
suffix: bool = True#