philentropyst
Version:
Efficient data masking tool
51 lines (49 loc) • 1.69 kB
YAML
schema:
version: 1.0
# csv is the only supported format yet
# Later we'll have support for json and other formats
csv:
delimiter: ,
multiline: true
allowQuotes: true
hasHeader: true
# force strings to be wrapped in double quotes
wrapStringInQuotes: true
# if false numbers and booleans become strings
parseNumbers: true
parseBooleans: true
# removes leading and trailing whitespaces - not good for fixed sized csvs
trim: true
# (optional) use this to indicate that lines are grouped by a certain field
# in that case the ref points to the column, and fields is a list of field references
# which should receive the same data per group, i.e. firstName, lastName
# group:
# ref: field1
# fields:
# - field2
# - firstName
# (optional) use cache to store previous field values and reuse them.
# A common use case is when you process multiple files, in which same data, e.g. persons,
# appear. So, you can keep consistent names across files
# cache:
# the name of the cache to be used - so you can work on different caches
# name: mycache
# fields:
# - field2
# - firstName
# masks define what fields has to be masked and how
masks:
- field:
# ref means either column index (starting with 0) or name if hasHeader=true
ref: field1
# type can be anything supported by https://github.com/marak/Faker.js/#api-methods
type: datatype.number
options:
min: 1000
max: 10000
- field:
ref: field2
type: date.past
- field:
ref: firstName
type: name.firstName