larksuite / larksuite/oapi-sdk-python

Add stream=True for file.download and media.download

Open
#105 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
559
Forks
102
PR merge metrics
No merged PRs in 30d

Description

User need

We must saving memory while download large file.

Requested feature

stream – (optional) if False, the response content will be immediately downloaded.
https://requests.readthedocs.io/en/latest/api/

Modify method Transport.execute to use requests stream argument.
https://github.com/larksuite/oapi-sdk-python/blob/9b1a69fecadddfe0815bb7a11ed73a0ce21623e7/lark_oapi/core/http/transport.py#L16

Maybe you can add stream into RequestOption, and stream_content into RawResponse.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lark_oapi/core/http/transport.py and trace RequestOption and RawResponse through file.download and media.download. Review the requests stream option and determine how opt-in streaming should be represented; the work is done when large downloads can avoid immediate buffering while preserving the existing behavior by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.