Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing ssl issue and async_timeout #292

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
beautifulsoup4
aiohttp
async_timeout>=3.0,<4.0
async_timeout
urllib3
requests
lxml
tqdm
tqdm
6 changes: 4 additions & 2 deletions secedgar/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ def __init__(self,
retry_count=3,
batch_size=10,
backoff_factor=0,
rate_limit=10):
rate_limit=5,
ssl_flag=True):
self.retry_count = retry_count
self.batch_size = batch_size
self.backoff_factor = backoff_factor
self.rate_limit = rate_limit
self.user_agent = user_agent
self.ssl_flag = ssl_flag

@property
def retry_count(self):
Expand Down Expand Up @@ -254,7 +256,7 @@ def batch(iterable, n):
for ndx in range(0, length, n):
yield iterable[ndx:min(ndx + n, length)]

conn = aiohttp.TCPConnector(limit=self.rate_limit)
conn = aiohttp.TCPConnector(limit=self.rate_limit, ssl=self.ssl_flag)
headers = {
"Connection": "keep-alive",
"User-Agent": self.user_agent,
Expand Down
Loading