Module YahooQuote :: Class Market
[show private | hide private]
[frames | no frames]

Class Market


Main top-level class for YahooQuote.

Holds/fetches info on a per-ticker basis

Use this like a dict, where the keys are ticker symbols, and the values are Ticker objects (see class Ticker)
Method Summary
  __init__(self)
Creates a 'Market' object, which accesses quotes for various ticker symbols through Ticker object
  __del__(self)
  __getitem__(self, symbol)
If 'symbol' is an index, returns an Index object for that index symbol.
  fetchHistory(self)
Fetches all history for all known stocks
  loadIndexes(self)
loads all index components.
  updateHistory(self)
Updates all known stocks' histories.

Method Details

__init__(self)
(Constructor)

Creates a 'Market' object, which accesses quotes for various ticker symbols through Ticker object

No args or keywords needed.

__getitem__(self, symbol)
(Indexing operator)

If 'symbol' is an index, returns an Index object for that index symbol.

If 'symbol' is an individual stock symbol, then returns a Ticker object for that stock

fetchHistory(self)

Fetches all history for all known stocks

This can take an hour or more, even with a broadband connection, and will leave you with a cache file of over 100MB.

You must call this before invoking Market.updateHistory

If you're only interested in specific stocks or indexes, you might prefer to invoke Index.fetchHistory or Ticker.FetchHistory, respectively.

loadIndexes(self)

loads all index components.

The first time this method is executed, it will download a list of component stocks for each index and store them in the database.

Subsequent calls to this method, even in future sessions, will just load these component stock lists from the database

updateHistory(self)

Updates all known stocks' histories. Don't run this unless you have previously invoked Market.fetchHistory

Generated by Epydoc 2.1 on Mon Jun 25 22:42:21 2007 http://epydoc.sf.net