DEV Community

Samandar Ravshanov
Samandar Ravshanov

Posted on • Edited on

📦 Redact any data at paths specified

from functorflow import f

# Redact any data at paths specified.

data = {
  'x': {'c': {'d': 'hide me', 'e': 'leave me be'}},
  'y': {'c': {'d': 'and me', 'f': 'dont touch'}},
}

r = f('redact', data, paths = ['*.c.d'] )
print(r) # {"x":{"c":{"d":"[REDACTED]","e":"leave me be"}},"y":{"c":{"d":"[REDACTED]","f":"dont touch"}}}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)