The sec-edgar-downloader package is very useful for fetching SEC filings. Currently, downloads are written to the file system, which works well for local storage.
However, for many use cases (e.g., automated parsing, streaming pipelines, or cloud-based environments), it would be convenient to retrieve the filing content directly in memory, using a BytesIO or StringIO object. This would allow users to process filings on the fly without writing temporary files to disk.
Suggested enhancement:
- Allow
Downloader.get() (or a new method/parameter) to return the content of the downloaded filing as a BytesIO or StringIO object.
- For example:
from sec_edgar_downloader import Downloader
from io import StringIO
dl = Downloader()
content = dl.get("10-K", "AAPL", amount=1, to_memory=True) # hypothetical flag
file_stream = StringIO(content)
Benefits:
- Avoids unnecessary disk I/O and temporary files.
- Facilitates cloud or serverless workflows.
- Simplifies parsing and integration into pipelines.
The
sec-edgar-downloaderpackage is very useful for fetching SEC filings. Currently, downloads are written to the file system, which works well for local storage.However, for many use cases (e.g., automated parsing, streaming pipelines, or cloud-based environments), it would be convenient to retrieve the filing content directly in memory, using a
BytesIOorStringIOobject. This would allow users to process filings on the fly without writing temporary files to disk.Suggested enhancement:
Downloader.get()(or a new method/parameter) to return the content of the downloaded filing as aBytesIOorStringIOobject.Benefits: