8 Commits

Author SHA1 Message Date
AlexCatarino 5ce7abce66 Adds Unit Tests for Compite and Backtest Requests
If any request returns `{'success': False}` or throws an exception, `Api.Execute` will not exit the execution, will log and return the result. This change will enable re-try logic.
2019-12-12 01:31:03 +00:00
AlexCatarino fe64fada3d Refactors Python Version of the API
- Refactor to simplify `quantconnect.api.Api` class. Adds `Execute` method that accepts a bolean to distinguish a `POST` from a `GET` request.

In the previous version, some methods were using the `params` argument instead of `data` in the `POST` case which threw an exception for big json objects.

- Adds option to save logs and backtest report to disk.
- Adds `Result` class to optionally convert the json objects into `pandas.DataFrame` when getting backtest or live results

- Subversion bump
2019-12-11 16:10:12 +00:00
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