Skip to content

Commit

Permalink
Add ChatGpt in Pib
Browse files Browse the repository at this point in the history
  • Loading branch information
akshata29 committed Jul 31, 2023
1 parent c87a568 commit 3ac77c8
Show file tree
Hide file tree
Showing 3 changed files with 522 additions and 56 deletions.
8 changes: 4 additions & 4 deletions api/Python/SecExtraction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def crawl(

# https://www.sec.gov/cgi-bin/browse-edgar?CIK=0001000228
# https://data.sec.gov/submissions/CIK0001000228.json
with open(os.path.join('', 'companies_info.json')) as f:
with open(os.path.join(tempfile.gettempdir(), 'companies_info.json')) as f:
company_info_dict = json.load(fp=f)

cik = series['CIK']
Expand Down Expand Up @@ -747,7 +747,7 @@ def crawl(
if 'Fiscal Year End' in str(content):
company_info_dict[cik]['Fiscal Year End'] = str(content).split()[-1]

with open(os.path.join('', 'companies_info.json'), 'w') as f:
with open(os.path.join(tempfile.gettempdir(), 'companies_info.json'), 'w') as f:
json.dump(obj=company_info_dict, fp=f, indent=4)

if pd.isna(series['SIC']):
Expand Down Expand Up @@ -988,8 +988,8 @@ def EdgarIngestion(value):
if not os.path.isdir(raw_filings_folder):
os.mkdir(raw_filings_folder)

if not os.path.isfile(os.path.join('', 'companies_info.json')):
with open(os.path.join('', 'companies_info.json'), 'w') as f:
if not os.path.isfile(os.path.join(tempfile.gettempdir(), 'companies_info.json')):
with open(os.path.join(tempfile.gettempdir(), 'companies_info.json'), 'w') as f:
json.dump(obj={}, fp=f)

downloadIndices(
Expand Down
Loading

0 comments on commit 3ac77c8

Please sign in to comment.