Skip to content

Feature: Add support for streaming ArchiveFiles #70

@Peilonrayz

Description

@Peilonrayz

I have some large files that I need to extract, given their size and that pylzma reads the entire file into memory, can a stream API be provided for py7zlib.ArchiveFile objects.

This could be via a read_streamed(chunk_size=...) -> Iterator[bytes] function or allowing a size to be entered into read - read(amount=None) -> bytes. Allowing users to roll their own read_streamed:

def read_streamed(archive, chunk_size):
    while True:
        data = archive.read(chunk_size)
        if not data:
            break
        yield data

This would allow:

  • Users to read large archived files, without breaking the computer.
  • Remove the need for Remaining progress callback #11 as users can implement this themselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions