def __getattr__(self, item):
        """
        Allows layers to be retrieved via get attr. For instance: pkt.ip
        """
        for layer in self.layers:
            if layer.layer_name.lower() == item.lower():
                return layer
        raise AttributeError(f"No attribute named {item}")

        Allows layers to be retrieved via get attr. For instance: pkt.ip
        
src/pyshark/packet/packet.py