Commit Graph

6 Commits

Author SHA1 Message Date
Tim Burke 552ceddc09 Stream downloaded data in more cases
Passing chunk_size=None to iter_content() works fine for chunk-encoded
responses, but still leaves us buffering the entire response when the
server just specifies a Content-Length.

Now, stream the response 256k at a time.

Why 256k? It's large enough that you won't be in a tight loop doing tiny
reads, but small enough that it shouldn't be any great memory concern.
If anyone finds that it's problematic, they can always monkey-patch
quantconnect.api.DOWNLOAD_CHUNK_SIZE.
2019-07-02 16:31:03 -07:00
Tim Burke 07acc2e738 Reduce memory usage in Api.download_data
Previously, the entire response would be read and buffered in memory
before any of it was written to disk.

Now, stream the response and write down data as it's received.
2019-06-27 09:54:49 -07:00
Tim Burke 80fe442e3d Fix NameError in Api.download_data
Closes #3078.
2019-06-27 09:52:26 -07:00
Gehad Wahgdy ae25c6fe54 Updated wrong docstrings 2019-02-01 21:22:46 +01:00
AlexCatarino 23c6ef8e0f Implements ReadBacktestReport method in the API 2018-06-08 17:04:13 +01:00
AlexCatarino 0be6e8fa1f Initial commit of LeanReportCreator
- Renames `ApiPython` project to `PythonToolbox`
- Moves `LeanReportCreator` from https://github.com/QuantConnect/LeanReportCreator to https://github.com/QuantConnect/Lean/tree/master/PythonToolbox.
- Fixes README.rst
- Add QuantConnect License header
2018-06-06 13:17:37 +01:00