zarr.abc.numcodec ================= .. py:module:: zarr.abc.numcodec Classes ------- .. autoapisummary:: zarr.abc.numcodec.Numcodec Module Contents --------------- .. py:class:: Numcodec Bases: :py:obj:`typing_extensions.Protocol` A protocol that models the ``numcodecs.abc.Codec`` interface. This protocol should be considered experimental. Expect the type annotations for ``buf`` and ``out`` to narrow in the future. .. !! processed by numpydoc !! .. py:method:: decode(buf: Any, out: Any | None = None) -> Any Decode data in ``buf``. :Parameters: **buf** : Any Encoded data. **out** : Any Writeable buffer to store decoded data. If provided, this buffer must be exactly the right size to store the decoded data. :Returns: **dec** : Any Decoded data. .. !! processed by numpydoc !! .. py:method:: encode(buf: Any) -> Any Encode data from ``buf``. :Parameters: **buf** : Any Data to be encoded. :Returns: enc: Any Encoded data. .. !! processed by numpydoc !! .. py:method:: from_config(config: Any) -> Self :classmethod: Instantiate a codec from a configuration dictionary. :Parameters: **config** : Any A configuration dictionary for this codec. .. !! processed by numpydoc !! .. py:method:: get_config() -> Any Return a JSON-serializable configuration dictionary for this codec. Must include an ``'id'`` field with the codec identifier. .. !! processed by numpydoc !! .. py:attribute:: codec_id :type: str