Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dda5dd1

Browse filesBrowse files
committed
Fix Filings Params Bug
1 parent 31fbcb0 commit dda5dd1
Copy full SHA for dda5dd1

1 file changed

+27-17Lines changed: 27 additions & 17 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎edgar/filings.py‎

Copy file name to clipboardExpand all lines: edgar/filings.py
+27-17Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,26 @@ def __init__(self, session: EdgarSession) -> None:
4646
self.params = {
4747
'action': 'getcompany',
4848
'output': 'atom',
49+
'company': '',
4950
'CIK': '',
5051
'start': '0',
51-
'count': '100'
52+
'Count': '100',
53+
'datea': '',
54+
'dateb': ''
55+
}
56+
57+
def _reset_params(self) -> None:
58+
"""Resets the params for the next request."""
59+
60+
self.params = {
61+
'CIK': '',
62+
'company': '',
63+
'Count': '100',
64+
'action': 'getcompany',
65+
'output': 'atom',
66+
'start': '',
67+
'datea': '',
68+
'dateb': ''
5269
}
5370

5471
def __repr__(self) -> str:
@@ -106,7 +123,7 @@ def get_filings_by_cik(self, cik: str, start: int = 0, number_of_filings: int =
106123
num_of_items=number_of_filings
107124
)
108125

109-
self.params['CIK'] = ''
126+
self._reset_params()
110127

111128
return response
112129

@@ -169,8 +186,7 @@ def get_filings_by_type(self, cik: str, filing_type: Union[str, Enum], start: in
169186
num_of_items=number_of_filings
170187
)
171188

172-
self.params['CIK'] = ''
173-
self.params['type'] = ''
189+
self._reset_params()
174190

175191
return response
176192

@@ -268,22 +284,16 @@ def query(
268284
start=start
269285
)
270286

271-
self.params['start'] = start
272-
self.params['CIK'] = cik
273-
self.params['SIC'] = sic
274-
self.params['type'] = filing_type
275-
self.params['company'] = company_name
276-
self.params['datea'] = after_date
277-
self.params['dateb'] = before_date
287+
self._reset_params()
278288

279289
return entries
280290

281291
def get_filings_by_company_name(
282-
self,
283-
company_name: str,
284-
number_of_filings : int = 100,
285-
start : int = 0
286-
) -> List[dict]:
292+
self,
293+
company_name: str,
294+
number_of_filings: int = 100,
295+
start: int = 0
296+
) -> List[dict]:
287297
"""Returns all the filings (ownership and non-ownership).
288298
289299
### Parameters
@@ -322,6 +332,6 @@ def get_filings_by_company_name(
322332
start=start
323333
)
324334

325-
self.params['company'] = ''
335+
self._reset_params()
326336

327337
return entries

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.