forked from mariostoev/finviz
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bernardo Damele
committed
Apr 22, 2020
1 parent
3a3d0aa
commit f2e65e8
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/python3 | ||
|
||
from finviz.helper_functions.save_data import export_to_db, export_to_csv | ||
from finviz.screener import Screener | ||
from finviz.main_func import * | ||
|
||
#filters = [] | ||
#filters = ['geo_usa'] | ||
filters = ['idx_sp500'] # Shows companies in the S&P500 | ||
print("Filtering stocks..") | ||
stock_list = Screener(filters=filters, order='ticker') | ||
print("Parsing every stock..") | ||
stock_list.get_ticker_details() | ||
|
||
# Export the screener results to CSV file | ||
stock_list.to_csv('sp500.csv') | ||
|
||
# Create a SQLite database | ||
#stock_list.to_sqlite('sp500.sqlite') |