Skip to content

Feature request: Support downloading filings to memory (BytesIO/StringIO) #154

@YatharthVardan-SanDiego

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions