save method

On this page

save

Saves the redaction policy to a file.

def save(self, file_path):
    ...
Parameter Type Description
file_path str Path to file.

Example

    policy = RedactionPolicy([
        ExactPhraseRedaction("ACME", ReplacementOptions("[CO]")),
        RegexRedaction(r"\d{2,}", ReplacementOptions("[NUM]")),
    ])
    policy.save("./sample_policy.xml")
    ```

## save {#output}

Saves the redaction policy to a stream.

```python
def save(self, output):
    ...
Parameter Type Description
output io.RawIOBase Target stream to save the policy.

Returns: None.

See Also

On this page