Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions finrobot/data_source/sec_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def download_10k_filing(
with open(file_path, "w") as f:
f.write(file_content)
return f"{ticker}: download succeeded. Saved to {file_path}"
except:
return f"❌ {ticker}: downloaded failed: {url}"
except Exception as e:
return f"❌ {ticker}: download failed: {url} - {e}"
else:
return f"No 2023 10-K filing found for {ticker}"
return f"No 10-K filing found for {ticker} between {start_date} and {end_date}"

def download_10k_pdf(
ticker: Annotated[str, "ticker symbol"],
Expand Down Expand Up @@ -132,9 +132,9 @@ def download_10k_pdf(
file.write(chunk)
return f"{ticker}: download succeeded. Saved to {file_path}"
except Exception as e:
return f"❌ {ticker}: downloaded failed: {filing_url}, {e}"
return f"❌ {ticker}: download failed: {filing_url} - {e}"
else:
return f"No 2023 10-K filing found for {ticker}"
return f"No 10-K filing found for {ticker} between {start_date} and {end_date}"

def get_10k_section(
ticker_symbol: Annotated[str, "ticker symbol"],
Expand Down
Loading