How to use the scrapbook.encoders.registry.decode function in scrapbook

To help you get started, we’ve selected a few scrapbook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / scrapbook / scrapbook / models.py View on Github external
def _extract_papermill_output_data(self, sig, payload):
        if sig.startswith(RECORD_PAYLOAD_PREFIX):
            # Fetch '+json' and strip the leading '+'
            encoder = sig.split(RECORD_PAYLOAD_PREFIX, 1)[1][1:]
            # First key is the only named payload
            for name, data in payload.items():
                return encoder_registry.decode(Scrap(name, data, encoder))