(self, scrap, **kwargs)
return output_scrap
Finds the register for the given encoder and translates the scrap's data
        from an object of the encoder type to a JSON typed object.

        Parameters
        ----------
        scrap: Scrap
            A partially filled in scrap with data that needs encoding
Finds the register for the given encoder and translates the scrap's data
        from an object of the encoder type to a JSON typed object.
Finds the register for the given encoder and translates the scrap s data from an object of the encoder type to a JSON typed object .
def encode(self, scrap, **kwargs):
        """
        Finds the register for the given encoder and translates the scrap's data
        from an object of the encoder type to a JSON typed object.

        Parameters
        ----------
        scrap: Scrap
            A partially filled in scrap with data that needs encoding
        """
        encoder = self._encoders.get(scrap.encoder)
        if not encoder:
            raise ScrapbookMissingEncoder(
                'No encoder found for "{data_type}" data type!'.format(data_type=encoder)
            )
        output_scrap = encoder.encode(scrap, **kwargs)
        # Run validation on encoded data
        scrap_to_payload(output_scrap)
        return output_scrap
def encode ( self , scrap , * * kwargs ) : encoder = self . _encoders . get ( scrap . encoder ) if not encoder : raise ScrapbookMissingEncoder ( 'No encoder found for "{data_type}" data type!' . format ( data_type = encoder ) ) output_scrap = encoder . encode ( scrap , * * kwargs ) # Run validation on encoded data scrap_to_payload ( output_scrap ) return output_scrap