Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
killed process fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Athe-kunal committed Feb 3, 2024
1 parent 441414b commit d0a0e70
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion llama_hub/sec_filings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python install -r requirements.txt
The SEC Downloader expects 4 attributes

* tickers: It is a list of valid tickers
* forms (List): 10-K or 10-Q or S-1 filing type
* filing_types (List): 10-K or 10-Q or S-1 filing type
* include_amends: To include amendments or not.
* year: The year for which you need the data

Expand Down
6 changes: 3 additions & 3 deletions llama_hub/sec_filings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(
self,
ticker: str,
year: int,
filing_type: List[str],
filing_types: List[str],
include_amends: bool = True,
amount: int = None,
):
Expand All @@ -27,7 +27,7 @@ def __init__(

self.ticker = ticker
self.year = str(year)
self.forms = filing_type
self.filing_types = filing_types
self.include_amends = include_amends
if amount is not None:
warnings.warn(
Expand All @@ -39,7 +39,7 @@ def __init__(

def load_data(self) -> List[Document]:
section_texts = sec_main(
self.ticker, self.year, self.forms, self.include_amends
self.ticker, self.year, self.filing_types, self.include_amends
)
docs = []
for filings in section_texts:
Expand Down
6 changes: 6 additions & 0 deletions llama_hub/sec_filings/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from base import SECFilingsLoader

if __name__ == '__main__':
docs = SECFilingsLoader(ticker="AAPL",year=2023,filing_types=["10-K","10-Q"])
d = docs.load_data()
print(d)
10 changes: 6 additions & 4 deletions llama_hub/sec_filings/secData.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@


def sec_main(
ticker: str, year: str, forms: List[str] = ["10-K", "10-Q"], include_amends=True
ticker: str, year: str, filing_types: List[str] = ["10-K", "10-Q"], include_amends=True
):
cik = get_cik_by_ticker(ticker)
rgld_cik = int(cik.strip("0"))

forms = []
if include_amends:
for form in forms:
for form in filing_types:
forms.append(form)
forms.append(form + "/A")

else:
forms = filing_types
url = f"https://data.sec.gov/submissions/CIK{cik}.json"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
Expand Down

0 comments on commit d0a0e70

Please sign in to comment.