bibble.fields.field_substitutor
Classes
For a given field(s), and a given jgdv.SubstitutionFile, |
Module Contents
- class bibble.fields.field_substitutor.FieldSubstitutor(
- *,
- fields,
- subs,
- force_single_value=False,
- **kwargs,
Bases:
bibble.util.middlecore.IdenBlockMiddlewareFor a given field(s), and a given jgdv.SubstitutionFile,
replace the field value as necessary in each entry.
If force_single_value is True, only the first replacement will be used, others will be discarded
eg: for target=[‘tags’], and subs({‘AI’: [‘artificial_intelligence’, ‘agents’, ‘machine_learning’]) and entry(fields={‘tags’: ‘ai’}) will give: entry(fields={‘’tags’: [‘artificial_intelligence’, ‘agents’, ‘machine_learning’]})
- _force_single_value = False
- _subs