Skip to main content
`Ctrl`+`K`

# Codec registry

The registry module provides some simple convenience functions to enable applications to dynamically register and look-up codec classes.

numcodecs.registry.get_codec(config)

  Obtain a codec for the given configuration.

  Parameters:
    config dict-like

      Configuration object.

  Returns:
    codec Codec

  Examples

      >>> import numcodecs as codecs
      >>> codec = codecs.get_codec(dict(id='zlib', level=1))
      >>> codec
      Zlib(level=1)

numcodecs.registry.register_codec(cls, codec_id=None)

  Register a codec class.

  Parameters:
    cls Codec class

  Notes

  This function maintains a mapping from codec identifiers to codec classes. When a codec class is registered, it will replace any class previously registered under the same codec identifier, if present.