dgunning / edgartools

Navigate SEC Edgar data in Python
MIT License
516 stars 101 forks source link

Bulk Download Gives Error #132

Closed webbsledge closed 3 weeks ago

webbsledge commented 4 weeks ago

Downloading bulk data appears to be a pretty simple process, but gives an error. The initializing code is:

from edgar import *
set_identity('myActualEmail@address.com')
download_edgar_data()

but returns an error:

Traceback (most recent call last): File "/Users/sledge/Development/Python/edgartools/local_data/download.py", line 3, in download_edgar_data()


File "/Users/sledge/Development/Python/edgartools/edgar/core.py", line 251, in download_edgar_data
download_submissions()
~~~~~~~~~~~~~~~~~~~~^^
File "/Users/sledge/Development/Python/edgartools/edgar/entities.py", line 945, in download_submissions
return asyncio.run(download_submissions_async())
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 194, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 721, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/Users/sledge/Development/Python/edgartools/edgar/entities.py", line 938, in download_submissions_async
return await download_bulk_data("https://www.sec.gov/Archives/edgar/daily-index/bulkdata/submissions.zip")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sledge/Development/Python/edgartools/edgar/httprequests.py", line 607, in download_bulk_data
await stream_file(data_url, as_text=as_text, path=download_path)
File "/Users/sledge/Development/Python/edgartools/edgar/httprequests.py", line 491, in stream_file
content = await response.text()
^^^^^^^^^^^^^
File "/Users/sledge/Development/Python/edgartools/.venv/lib/python3.13/site-packages/httpx/_models.py", line 578, in text
content = self.content
^^^^^^^^^^^^
File "/Users/sledge/Development/Python/edgartools/.venv/lib/python3.13/site-packages/httpx/_models.py", line 572, in content
raise ResponseNotRead()
httpx.ResponseNotRead: Attempted to access streaming response content, without having called `read()`.
dgunning commented 3 weeks ago

The fix has been released in 3.0.1. Please test. Thanks again, much appreciated

webbsledge commented 3 weeks ago

@dgunning Yes, it's now working exactly as expected. Many thanks.

This Python package is extraordinary, btw. I am very impressed and appreciative.