error saving files
See original GitHub issueI installed the API and run the next couple of code lines. I got an error when I wanted to save the filing.
from secedgar.filings import FilingType, Filing
from datetime import datetime
filing = Filing(cik_lookup='aapl',
filing_type=FilingType.FILING_10K,
start_date=datetime(2015, 1, 1),
end_date=datetime(2019, 1, 1))
filing.save('./reports')
The following error is rising when I run the last command:
`--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-9-ae9d2e927b58> in <module> ----> 1 filing.save(‘FFS’)
~.conda\envs\Keras\lib\site-packages\secedgar\filings\filing.py in save(self, directory, dir_pattern, file_pattern) 222 223 loop = asyncio.get_event_loop() –> 224 loop.run_until_complete(self.client.wait_for_download_async(inputs))
~.conda\envs\Keras\lib\asyncio\base_events.py in run_until_complete(self, future) 568 future.add_done_callback(_run_until_complete_cb) 569 try: –> 570 self.run_forever() 571 except: 572 if new_task and future.done() and not future.cancelled():
~.conda\envs\Keras\lib\asyncio\base_events.py in run_forever(self) 523 self._check_closed() 524 if self.is_running(): –> 525 raise RuntimeError(‘This event loop is already running’) 526 if events._get_running_loop() is not None: 527 raise RuntimeError(
RuntimeError: This event loop is already running 10it [00:01, 9.88it/s]`
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:47 (32 by maintainers)
Top GitHub Comments
Hi guys, let me try this later and will let you know. Thanks!
Sent from my iPhone
Hi @jackmoody11 - I just tried WITHOUT importing
nest_asyncio
in my newly created environment, after saving to./edgar
as @reteps suggested, the download worked as expected.FYI - Interestingly, in my old base conda environment, without
nest_asyncio
, with./edgar
it still did not work…Looks like it was related to
save()
.