warn_transformer/transformers/oh.py
def transform_date(self, value: str) -> typing.Optional[str]:
        """Transform a raw date string into a date object.

        Args:
            value (str): The raw date string provided by the source

        Returns: A date object ready for consolidation. Or, if the date string is invalid, a None.
        """
        # Cut out cruft
        value = value.replace("Updated", "")
        value = value.replace("Revised", "")
        value = value.replace("-", "").strip()

        # Split double dates
        if len(value) == 20:
            value = value[:10]
        value = re.split(r"\s{2,}", value)[0].strip()
        value = value.split("Originated")[0].strip()

        try:
            return super().transform_date(value)
        except Exception:
            value = value.split(" to ")[0].strip()
            value = value.split()[0].strip()
            value = value.replace("‐", "")
            return super().transform_date(value)
Transform a raw date string into a date object.

        Args:
            value (str): The raw date string provided by the source

        Returns: A date object ready for consolidation. Or, if the date string is invalid, a None.
        
Transform a raw date string into a date object.
Transform a raw date string into a date object .
def transform_date(self, value: str) -> typing.Optional[str]:
        value = value.replace("Updated", "")
        value = value.replace("Revised", "")
        value = value.replace("-", "").strip()
        if len(value) == 20:
            value = value[:10]
        value = re.split(r"\s{2,}", value)[0].strip()
        value = value.split("Originated")[0].strip()
        try:
            return super().transform_date(value)
        except Exception:
            value = value.split(" to ")[0].strip()
            value = value.split()[0].strip()
            value = value.replace("‐", "")
            return super().transform_date(value)
def transform_date ( self , value : str ) -> typing . Optional [ str ] : value = value . replace ( "Updated" , "" ) value = value . replace ( "Revised" , "" ) value = value . replace ( "-" , "" ) . strip ( ) if len ( value ) == 20 : value = value [ : 10 ] value = re . split ( r"\s{2,}" , value ) [ 0 ] . strip ( ) value = value . split ( "Originated" ) [ 0 ] . strip ( ) try : return super ( ) . transform_date ( value ) except Exception : value = value . split ( " to " ) [ 0 ] . strip ( ) value = value . split ( ) [ 0 ] . strip ( ) value = value . replace ( "‐",  " ) return super ( ) . transform_date ( value )
Transform a raw date string into a date object.
Transform a raw date string into a date object .
"""Transform a raw date string into a date object.

        Args:
            value (str): The raw date string provided by the source

        Returns: A date object ready for consolidation. Or, if the date string is invalid, a None.
        """ # Cut out cruft # Split double dates
self
value
str
The raw date string provided by the source
The raw date string provided by the source