Skip to content

Commit

Permalink
Added declared_user variable input to allow users to input their user…
Browse files Browse the repository at this point in the history
… agent. Relates to issue #6.
  • Loading branch information
git-shogg committed May 15, 2024
1 parent d0e4590 commit c7c45bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Check out these blog posts for detailed tutorials with code examples:

```python
import finsec
filing = finsec.Filing('0001067983')
filing = finsec.Filing('0001067983') # Optional declared user variable can be input here (e.g. declared_user="Joe Blog [email protected]")

# Return the latest 13F reported holdings for Berkshire Hathaway.
print(filing.latest_13f_filing)
Expand Down
5 changes: 3 additions & 2 deletions finsec/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
}

class FilingBase():
def __init__(self, cik):

def __init__(self, cik, declared_user=None):
if declared_user is not None:
_REQ_HEADERS_["User-Agent"] = declared_user+";"+_REQ_HEADERS_["User-Agent"]
self.cik = self._validate_cik(cik)
self.manager = None
self._last_100_13f_filings_url = None
Expand Down
2 changes: 1 addition & 1 deletion finsec/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.0.9"
version = "0.0.10"

0 comments on commit c7c45bf

Please sign in to comment.