as_dict#

scikitplot.cleanprompt.as_dict(obj)[source]#

Return a JSON-safe, secret-free dictionary for a result object.

Parameters:
objRedactionResult or RestorationResult or Stats

The value to describe.

Returns:
dict

A plain dictionary. Secrets are never included: Entry is rendered without its original field.

Raises:
TypeError

If obj is not one of the supported result types.

Parameters:

obj (Any)

Return type:

dict[str, Any]

Notes

Developer notes. This is the only sanctioned serializer for results. dataclasses.asdict would walk into Entry.original and emit the secrets, which is exactly the mistake that made the upstream web tier ship personal data to the browser.