File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ def _download_file(
290290 ]
291291
292292 headers : Dict [str , str ] = self ._headers .copy ()
293+ mode = "wb"
293294
294295 # Check if file already exists in partially downloaded state
295296 if os .path .isfile (output_path ):
@@ -298,6 +299,7 @@ def _download_file(
298299 # Make range request for partial download,
299300 # will be from next byte to end of file.
300301 headers ["Range" ] = f"bytes={ existing_size } -{ filesize - 1 } "
302+ mode = "ab"
301303
302304 with requests .get (
303305 url = self ._base_url + ".download" ,
@@ -309,6 +311,6 @@ def _download_file(
309311 ) as response :
310312 check_http_error (response )
311313
312- with open (output_path , mode = "wb" ) as f :
314+ with open (output_path , mode = mode ) as f :
313315 for chunk in response .iter_content ():
314316 f .write (chunk )
Original file line number Diff line number Diff line change 1+ from pprint import pprint
2+
3+ import databento as db
4+
5+
6+ if __name__ == "__main__" :
7+ db .log = "debug" # Optional debug logging
8+
9+ key = "YOUR_API_KEY"
10+ client = db .Historical (key = key )
11+
12+ response = client .batch .list_files (
13+ job_id = "YOUR_JOB_ID" , # <-- Discover this from `.list_jobs(...)`
14+ )
15+
16+ pprint (response )
You can’t perform that action at this time.
0 commit comments