serializers
            Compressor
¶
    
              Bases: ABC
Source code in pyiceberg/serializers.py
                
            bytes_compressor()
  
      abstractmethod
  
¶
    Return a function to compress bytes.
Returns:
| Type | Description | 
|---|---|
| Callable[[bytes], bytes] | A function that can be used to compress bytes. | 
            stream_decompressor(inp)
  
      abstractmethod
  
¶
    Return a stream decompressor.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| inp | InputStream | The input stream that needs decompressing. | required | 
Returns:
| Type | Description | 
|---|---|
| InputStream | The wrapped stream | 
            FromByteStream
¶
    A collection of methods that deserialize dictionaries into Iceberg objects.
Source code in pyiceberg/serializers.py
                
            table_metadata(byte_stream, encoding=UTF8, compression=NOOP_COMPRESSOR)
  
      staticmethod
  
¶
    Instantiate a TableMetadata object from a byte stream.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| byte_stream | InputStream | A file-like byte stream object. | required | 
| encoding | default "utf-8" | The byte encoder to use for the reader. | UTF8 | 
| compression | Compressor | Optional compression method | NOOP_COMPRESSOR | 
Source code in pyiceberg/serializers.py
              
            FromInputFile
¶
    A collection of methods that deserialize InputFiles into Iceberg objects.
Source code in pyiceberg/serializers.py
                
            table_metadata(input_file, encoding=UTF8)
  
      staticmethod
  
¶
    Create a TableMetadata instance from an input file.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| input_file | InputFile | A custom implementation of the iceberg.io.file.InputFile abstract base class. | required | 
| encoding | str | Encoding to use when loading bytestream. | UTF8 | 
Returns:
| Name | Type | Description | 
|---|---|---|
| TableMetadata | TableMetadata | A table metadata instance. | 
Source code in pyiceberg/serializers.py
              
            ToOutputFile
¶
    A collection of methods that serialize Iceberg objects into files given an OutputFile instance.
Source code in pyiceberg/serializers.py
                
            table_metadata(metadata, output_file, overwrite=False)
  
      staticmethod
  
¶
    Write a TableMetadata instance to an output file.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| output_file | OutputFile | A custom implementation of the iceberg.io.file.OutputFile abstract base class. | required | 
| overwrite | bool | Where to overwrite the file if it already exists. Defaults to  | False |