(db, iteration_key, view_name, view_keys, chunk_size=100, view_event_handler=None, full_row=False)
return ResumableDocsIterator(iteration_key, data_function, args_provider, view_event_handler)
Perform one-time resumable iteration over a CouchDB View

    Iteration can be efficiently stopped and resumed. The iteration may
    omit documents that are added after the iteration begins or resumes
    and may include deleted documents.

    :param db: Couchdb database.
    :param iteration_key: A unique key identifying the iteration. This
    key will be used to maintain state about an iteration that is in progress.
    The state will be maintained indefinitely unless it is removed with `discard_state()`.
    :param view_name: The name of the CouchDB view to query
    :param view_keys: List of view keys to use when querying the view.
    :param chunk_size: Number of documents to yield before updating the
    iteration checkpoint. In the worst case about this many documents
    that were previously yielded may be yielded again if the iteration
    is stopped and later resumed.
Perform one-time resumable iteration over a CouchDB View
Perform one - time resumable iteration over a CouchDB View
def resumable_view_iterator(db, iteration_key, view_name, view_keys, chunk_size=100, view_event_handler=None, full_row=False):
    """Perform one-time resumable iteration over a CouchDB View

    Iteration can be efficiently stopped and resumed. The iteration may
    omit documents that are added after the iteration begins or resumes
    and may include deleted documents.

    :param db: Couchdb database.
    :param iteration_key: A unique key identifying the iteration. This
    key will be used to maintain state about an iteration that is in progress.
    The state will be maintained indefinitely unless it is removed with `discard_state()`.
    :param view_name: The name of the CouchDB view to query
    :param view_keys: List of view keys to use when querying the view.
    :param chunk_size: Number of documents to yield before updating the
    iteration checkpoint. In the worst case about this many documents
    that were previously yielded may be yielded again if the iteration
    is stopped and later resumed.
    """

    def data_function(**view_kwargs):
        view_kwargs["limit"] = chunk_size
        return db.view(view_name, **view_kwargs)

    if isinstance(view_keys[0], dict):
        args_provider = MultiKwargViewArgsProvider(view_keys, include_docs=True)
    else:
        args_provider = MultiKeyViewArgsProvider(view_keys, include_docs=True)
    args_provider.initial_view_kwargs.pop("limit")

    class ResumableDocsIterator(ResumableFunctionIterator):
        def __iter__(self):
            for result in super(ResumableDocsIterator, self).__iter__():
                yield result if full_row else result['doc']

    return ResumableDocsIterator(iteration_key, data_function, args_provider, view_event_handler)
def resumable_view_iterator ( db , iteration_key , view_name , view_keys , chunk_size = 100 , view_event_handler = None , full_row = False ) : def data_function ( * * view_kwargs ) : view_kwargs [ "limit" ] = chunk_size return db . view ( view_name , * * view_kwargs ) if isinstance ( view_keys [ 0 ] , dict ) : args_provider = MultiKwargViewArgsProvider ( view_keys , include_docs = True ) else : args_provider = MultiKeyViewArgsProvider ( view_keys , include_docs = True ) args_provider . initial_view_kwargs . pop ( "limit" ) class ResumableDocsIterator ( ResumableFunctionIterator ) : def __iter__ ( self ) : for result in super ( ResumableDocsIterator , self ) . __iter__ ( ) : yield result if full_row else result [ 'doc' ] return ResumableDocsIterator ( iteration_key , data_function , args_provider , view_event_handler )