warn_transformer/transformers/la.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 corrections before we edit the string
        try:
            dt = self.date_corrections[value]
            if dt:
                return str(dt.date())
            else:
                assert dt is None
                return dt
        except KeyError:
            pass

        # A little custom clean up based on the weird stuff from this source
        value = value.replace("starting", "")
        value = value.strip().split(" and ")[0].strip()
        value = value.strip().split(" to ")[0].strip()
        value = value.strip().split(" - ")[0].strip()
        value = value.strip().split(" & ")[0].strip()
        value = value.strip().split(" – ")[0].strip()
        value = value.strip().split("-")[0].strip()
        value = value.strip().split()[0].strip()

        # The same old stuff
        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.replace("starting", "")
        value = value.strip().split(" and ")[0].strip()
        value = value.strip().split(" to ")[0].strip()
        value = value.strip().split(" - ")[0].strip()
        value = value.strip().split(" & ")[0].strip()
        value = value.strip().split(" – ")[0].strip()
        value = value.strip().split("-")[0].strip()
        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 . replace ( "starting" , "" ) value = value . strip ( ) . split ( " and " ) [ 0 ] . strip ( ) value = value . strip ( ) . split ( " to " ) [ 0 ] . strip ( ) value = value . strip ( ) . split ( " - " ) [ 0 ] . strip ( ) value = value . strip ( ) . split ( " & " ) [ 0 ] . strip ( ) value = value . strip ( ) . split ( " – ")[ 0 ] . s t rip() value = value . strip ( ) . split ( "-" ) [ 0 ] . strip ( ) 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.
        """ # Try corrections before we edit the string # A little custom clean up based on the weird stuff from this source # The same old stuff
self
value
str
The raw date string provided by the source
The raw date string provided by the source