warn_transformer/transformers/ct.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.
        """
        try:
            dt = self.date_corrections[value]
            if dt:
                return str(dt.date())
            else:
                assert dt is None
                return dt
        except KeyError:
            pass
        value = value.lower()
        value = value.replace("beginning", "")
        value = value.replace("after", "")
        value = value.replace("estimated", "")
        value = value.replace(";", "")
        value = value.replace("*", "")
        value = value.strip().split()[0].strip()
        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]:
        try:
            dt = self.date_corrections[value]
            if dt:
                return str(dt.date())
            else:
                assert dt is None
                return dt
        except KeyError:
            pass
        value = value.lower()
        value = value.replace("beginning", "")
        value = value.replace("after", "")
        value = value.replace("estimated", "")
        value = value.replace(";", "")
        value = value.replace("*", "")
        value = value.strip().split()[0].strip()
        return super().transform_date(value)
def transform_date ( self , value : str ) -> typing . Optional [ str ] : try : dt = self . date_corrections [ value ] if dt : return str ( dt . date ( ) ) else : assert dt is None return dt except KeyError : pass value = value . lower ( ) value = value . replace ( "beginning" , "" ) value = value . replace ( "after" , "" ) value = value . replace ( "estimated" , "" ) value = value . replace ( ";" , "" ) value = value . replace ( "*" , "" ) value = value . strip ( ) . split ( ) [ 0 ] . strip ( ) 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.
        """
self
value
str
The raw date string provided by the source
The raw date string provided by the source