.. _bibble.fields.field_substitutor: =============================== bibble.fields.field_substitutor =============================== .. py:module:: bibble.fields.field_substitutor Classes ------- .. autoapisummary:: bibble.fields.field_substitutor.FieldSubstitutor Module Contents =============== .. _bibble.fields.field_substitutor.FieldSubstitutor: .. py:class:: FieldSubstitutor(*, fields, subs, force_single_value = False, **kwargs) Bases: :py:obj:`bibble.util.middlecore.IdenBlockMiddleware` For 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']}) .. py:method:: field_h(field, entry) -> .. py:method:: transform_Entry(entry, library) -> .. py:attribute:: _force_single_value :value: False .. py:attribute:: _subs