.. _bibble.metadata.key_locker: ========================== bibble.metadata.key_locker ========================== .. py:module:: bibble.metadata.key_locker Classes ------- .. autoapisummary:: bibble.metadata.key_locker.KeyLocker Module Contents =============== .. _bibble.metadata.key_locker.KeyLocker: .. py:class:: KeyLocker(*, regex = None, sub = None, lock_suffix = None, key_suffix = None, **kwargs) Bases: :py:obj:`bibble.util.middlecore.IdenBlockMiddleware` Ensure key/crossref consistency by: removing unwanted chars in the key, 'locking' the key with a specific suffix (by default a '_'). Also formats crossref values so they match. Already locked keys are ignored. __init__ takes: - regex = the regex of chars to remove. - sub = the substitute for removed chars .. py:method:: clean_key(key) -> Convert the entry key to a canonical form .. py:method:: on_read() -> .. py:method:: transform_Entry(entry, library) -> .. py:attribute:: _bad_lock :type: str :value: '__' .. py:attribute:: _key_suffix_re :type: jgdv.Rx .. py:attribute:: _lock_suffix :type: str :value: '_' .. py:attribute:: _remove_re :type: jgdv.Rx .. py:attribute:: _sub :type: str :value: '_'