Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Expose contents of an entry as a filelike object

Đang mở
#144 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
51/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading the archive entry API, especially get_blocks(), and check how this library exposes helpers for reading entry contents. The issue suggests returning an in-memory file-like object, with BytesIO as an example. Done means the library offers a helper for accessing an entry's contents this way; the issue does not name a test or file.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature

The data I'm working with is provided as a RAR containing several NPY files. To avoid complex external pre-processing and pointless temporary files, I was trying to keep everything in Python. That is fully possible as Numpy can be given not just a file path but any file-like object. Doing the plumbing manually turns out to be relatively straightforward:

def extract_into_memory(archive_entry):
    import io
    contents = io.BytesIO()
    for block in archive_entry.get_blocks():
        contents.write(block)
    contents.seek(0)
    return contents

But maybe it would be worthwhile to include a similar helper function as part of this library?

Ngôn ngữ chính
Python
Star
84
Fork
41
Merge trung bình
6 ngày 12 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Changaco/python-libarchive-c

Tất cả issue của Changaco/python-libarchive-c

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.