diff --git a/metrik/__init__.py b/metrik/__init__.py index 6540f83..5f26bd4 100644 --- a/metrik/__init__.py +++ b/metrik/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.3.9' +__version__ = '0.4.0' __release__ = __version__ \ No newline at end of file diff --git a/metrik/default.conf b/metrik/default.conf index a220171..32fa605 100644 --- a/metrik/default.conf +++ b/metrik/default.conf @@ -8,4 +8,21 @@ mongo_database=metrik consumer_key= consumer_secret= oauth_token= -oauth_token_secret= \ No newline at end of file +oauth_token_secret= + +[statestreet] +etf_holdings: +# Dow Jones + DIA, +# Russell 1000, 2000, 3000 + ONEK,TWOK,THRK, +# S&P 500, small-cap, mid-cap, and growth + SPY,SLY,MDY,SPYG, +# Sector-specific + XLY,XLP,XLE,XLF,XLFS,XLV,XLB,XLRE,XLK,XLU, +# Smart-beta + SPYD,ONEV,ONEO,ONEY,SPYB, +# Active ETFs + SYE,SYG,SYV, +# Environmental, Social, Governance + LOWC,SPYX,SHE \ No newline at end of file diff --git a/metrik/flows/equities_flow.py b/metrik/flows/equities_flow.py index fa4c501..27edadb 100644 --- a/metrik/flows/equities_flow.py +++ b/metrik/flows/equities_flow.py @@ -1,6 +1,8 @@ from metrik.flows.base import Flow, MarketClose from metrik.tasks.nasdaq import NasdaqETFList, NasdaqCompanyList from metrik.tasks.tradeking import Tradeking1mTimesales +from metrik.tasks.state_street import StateStreetHoldings +from metrik.conf import get_config class EquitiesFlow(Flow): @@ -12,6 +14,8 @@ class EquitiesFlow(Flow): return MarketClose() def _run(self): + config = get_config() + # When we yield dependencies in `run` instead of `_requires`, # they get executed dynamically and we can use their results inline etfs = NasdaqETFList(current_datetime=self.present, live=self.live) @@ -32,3 +36,11 @@ class EquitiesFlow(Flow): symbol=c['Symbol'] ) for c in companies.output().retrieve()['companies']] yield tradeking_companies + + state_street_etfs = config.get('statestreet', 'etf_holdings') + state_street_holdings = [ + StateStreetHoldings(current_datetime=self.present, live=self.live, + ticker=t.strip()) + for t in state_street_etfs.split(',') + ] + yield state_street_holdings