class documentation

A policy is a configuration that influences the behavior of various pyzim classes, mostly in regards to resource management.

Method __init__ The default constructor.
Instance Variable autoflush automatically write modified clusters and entries. Requires caches to be used. NOTE: cache size should be at leat be 2 in this case!
Instance Variable cluster_cache_class class to use for caching clusters
Instance Variable cluster_cache_kwargs keyword arguments to pass to the cluster_cache_class
Instance Variable cluster_class cluster implementation to use
Instance Variable compression_options options for to pass to pyzim.compression.BaseCompressionInterface
Instance Variable compression_strategy_class compression strategy to use when writing new items
Instance Variable compression_strategy_kwargs kwargs of compression strategy to use (excluding "zim")
Instance Variable counter how the counter should be loaded/initialized, see pyzim.counter.Counter.load_from_archive
Instance Variable entry_cache_class class to use for caching entries
Instance Variable entry_cache_kwargs keyword arguments to pass to the entry_cache_class
Instance Variable ordered_pointer_list_class ordered pointer list implementation to use
Instance Variable reserve_mimetype_space number of bytes after the header to reserve for the mimetypelist, None to disable. Will likely be removed in the future.
Instance Variable simple_pointer_list_class simple pointer list implementation to use
Instance Variable title_pointer_list_class title pointer list implementation to use
Instance Variable truncate if nonzero, truncate when flushing the file
Instance Variable uncompressed_compression_strategy_class compression strategy to use when writing new items for the uncompressed clusters
Instance Variable uncompressed_compression_strategy_kwargs kwargs of compression strategy to use (excluding "zim")
def __init__(self, compression_options={}, cluster_class=None, simple_pointer_list_class=None, ordered_pointer_list_class=None, title_pointer_list_class=None, entry_cache_class=None, entry_cache_kwargs=None, cluster_cache_class=None, cluster_cache_kwargs=None, compression_strategy_class=None, compression_strategy_kwargs=None, uncompressed_compression_strategy_class=None, uncompressed_compression_strategy_kwargs=None, autoflush=True, truncate=False, reserve_mimetype_space=2048, counter='load_or_reinit'):

The default constructor.

Parameters
compression_options:dictoptions for to pass to pyzim.compression.BaseCompressionInterface
cluster_class:a class (pyzim.cluster.Cluster or a subclass) or Nonecluster implemenetation to use
simple_pointer_list_class:a class (pyzim.pointerlist.SimplePointerList or a subclass) or NoneUndocumented
ordered_pointer_list_class:a class (pyzim.pointerlist.OrderedPointerList or a subclass) or NoneUndocumented
title_pointer_list_class:a class (pyzim.pointerlist.TitlePointerList or a subclass) or NoneUndocumented
entry_cache_class:a subclass of pyzim.cache.BaseCache or Noneclass to use for caching entries
entry_cache_kwargs:dict or Nonekeyword arguments to pass to the entry_cache_class
cluster_cache_class:a subclass of pyzim.cache.BaseCache or Noneclass to use for caching clusters
cluster_cache_kwargs:dict or Nonekeyword arguments to pass to the cluster_cache_class
compression_strategy_class:subclass of pyzim.compressionstrategy.BaseCompressionStrategy or Nonecompression strategy to use when writing new items
compression_strategy_kwargs:dict or NoneUndocumented
uncompressed_compression_strategy_class:pyzim.compressionstrategy.BaseCompressionStrategyUndocumented
uncompressed_compression_strategy_kwargs:dict or NoneUndocumented
autoflush:boolautomatically write modified clusters and entries. Requires caches to be used. NOTE: cache size should be at leat be 2 in this case!
truncate:boolif nonzero, truncate when flushing the file
reserve_mimetype_space:int or Nonenumber of bytes after the header to reserve for the mimetypelist, None to disable. Will likely be removed in the future.
counter:strhow the counter should be loaded/initialized, see pyzim.counter.Counter.load_from_archive
autoflush: bool =

automatically write modified clusters and entries. Requires caches to be used. NOTE: cache size should be at leat be 2 in this case!

cluster_cache_class: a subclass of pyzim.cache.BaseCache =

class to use for caching clusters

cluster_cache_kwargs: dict =

keyword arguments to pass to the cluster_cache_class

cluster_class: a class (pyzim.cluster.Cluster or a subclass) =

cluster implementation to use

compression_options: dict =

compression strategy to use when writing new items

compression_strategy_kwargs: dict =

kwargs of compression strategy to use (excluding "zim")

counter: str =

how the counter should be loaded/initialized, see pyzim.counter.Counter.load_from_archive

entry_cache_class: a subclass of pyzim.cache.BaseCache =

class to use for caching entries

entry_cache_kwargs: dict =

keyword arguments to pass to the entry_cache_class

ordered_pointer_list_class: a class (pyzim.pointerlist.OrderedPointerList or a subclass) =

ordered pointer list implementation to use

reserve_mimetype_space: int or None =

number of bytes after the header to reserve for the mimetypelist, None to disable. Will likely be removed in the future.

simple_pointer_list_class: a class (pyzim.pointerlist.SimplePointerList or a subclass) =

simple pointer list implementation to use

title_pointer_list_class: a class (pyzim.pointerlist.TitlePointerList or a subclass) =

title pointer list implementation to use

truncate: bool =

if nonzero, truncate when flushing the file

uncompressed_compression_strategy_class: pyzim.compressionstrategy.BaseCompressionStrategy =

compression strategy to use when writing new items for the uncompressed clusters

uncompressed_compression_strategy_kwargs: dict =

kwargs of compression strategy to use (excluding "zim")