Tasks#

Periodic tasks defined by the shares app. The full schedule, queue routing, and worker invocation flags are in Tasks. Most tasks sleep 5s between items when iterating over the full share list to avoid hammering upstream APIs.

Price history#

richy.shares.tasks.fetch_historical_data.__wrapped__(share=None)#

Fetches fresh historical data (prices) for the given share. Already existing price records gets updated if price differs (solves splits). If no share was given then fetches data for all shares.

If new data has been found we update caches and regenerate performance chart.

Parameters:

share (int) – Share PK.

richy.shares.tasks.fetch_current_price.__wrapped__(share=None)#

Fetches current market price and caches it under “item-{}-current-price” key for ITEM_CURRENT_PRICE_TIMEOUT. If no share PK instance is given fetches all shares in database. Sleeps 5 seconds between each fetch.

Parameters:

share (int) – Share PK.

Reference data#

richy.shares.tasks.fetch_basic_info.__wrapped__(share=None)#

Downloads basic info and saves it to ItemData models.

Parameters:

share (int) – Share PK.

richy.shares.tasks.fetch_financial_data.__wrapped__(share=None)#

Fetches financial data for all or the given share. Financial data are: - earnings - revenues - EPS

Parameters:

share (int) – Share PK.

Dividends#

richy.shares.tasks.fetch_dividends.__wrapped__(share=None)#

Downloads dividends and saves it to Dividend models. Sleeps 5 seconds between each fetch.

Parameters:

share (int) – Share PK.

Ratings#

richy.shares.tasks.fetch_ratings.__wrapped__(share=None)#

Fetches analyst ratings and saves it to Asset model. Sleeps 5 seconds between each fetch.

Parameters:

share (int) – Share PK.

richy.shares.tasks.fetch_price_ratings.__wrapped__(share=None)#

Fetches analyst price ratings and saves it to Asset model. Sleeps 5 seconds between each fetch.

Parameters:

share (int) – Share PK.