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

Additional insider options #22

Merged
merged 2 commits into from
Apr 22, 2021
Merged
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
14 changes: 13 additions & 1 deletion finvizfinance/insider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,29 @@ class Insider:
Getting information from the finviz insider page.

Args:
option (str): choose a option (latest, top week, top owner trade, insider_id)
option (str): choose a option (latest, latest buys, latest sales, top week, top week buys, top week sales, top owner trade, top owner buys, top owner sales, insider_id)
"""
def __init__(self, option='latest'):
"""initiate module
"""
if option == 'latest':
self.soup = webScrap(INSIDER_URL)
elif option == 'latest buys':
self.soup = webScrap(INSIDER_URL+'?tc=1')
elif option == 'latest sales':
self.soup = webScrap(INSIDER_URL+'?tc=2')
elif option == 'top week':
self.soup = webScrap(INSIDER_URL+'?or=-10&tv=100000&tc=7&o=-transactionValue')
elif option == 'top week buys':
self.soup = webScrap(INSIDER_URL+'?or=-10&tv=100000&tc=1&o=-transactionValue')
elif option == 'top week sales':
self.soup = webScrap(INSIDER_URL+'?or=-10&tv=100000&tc=2&o=-transactionValue')
elif option == 'top owner trade':
self.soup = webScrap(INSIDER_URL+'?or=10&tv=1000000&tc=7&o=-transactionValue')
elif option == 'top owner buys':
self.soup = webScrap(INSIDER_URL+'?or=10&tv=1000000&tc=1&o=-transactionValue')
elif option == 'top owner sales':
self.soup = webScrap(INSIDER_URL+'?or=10&tv=1000000&tc=2&o=-transactionValue')
elif option.isdigit():
self.soup = webScrap(INSIDER_URL+'?oc='+option+'&tc=7')
self.df = None
Expand Down