Share and Money Management  0.16
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
smm.quote.yahoo.YahooCSVFetchPlugin Class Reference

Share data tracker querying Yahoo finance data. More...

Inheritance diagram for smm.quote.yahoo.YahooCSVFetchPlugin:

Public Member Functions

def __init__
def getCurrent
 Obtain information from the data provider.

Public Attributes

 properties

Static Public Attributes

list field_symbols
 Yahoo encoded property names.
list field_names
 Property names.
tuple yahoo2smm
 Mapping of Yahoo properties to SMM properties.
list decimal_properties
 Decimal values.
list unicode_properties
 Unicode values.
int interface_version = 2
 Version number of the interface to access and convert the data.
string logger_name = 'smm.quote.yahoocsv'
 Name of the instance logger.
string name = u'Yahoo Finance CSV'
 Name of the data source.
int provider_id = 100
 Unique provider ID.
string provider_url = "http://download.finance.yahoo.com/d/quotes.csv"
 URL to query the data.
string dsep = u','
 Decimal separator for converting strings to decimal values.
 tsep = None
 Thousands separator for converting strings to decimal values.

Detailed Description

Share data tracker querying Yahoo finance data.

This tracker uses the Yahoo CSV API.

Constructor & Destructor Documentation

def smm.quote.yahoo.YahooCSVFetchPlugin.__init__ (   self)

Member Function Documentation

def smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent (   self,
  request 
)

Obtain information from the data provider.

Parameters
selfThe object instance itself
requestSee example
Example:
>>> import pprint
>>> pprint.pprint(request)
{u'DE0005003404': {'exchange.symbol': u'DE',
'share.isin': u'DE0005003404',
'share.symbol': u'ADS',
'share.wkn': u'500340'}}
>>> result = provider.getCurrent(request)
>>> pprint.pprint(result)
{u'DE0005003404': {'currency.code': 'EUR',
'errormsg': None,
'exchange.symbol': u'DE',
'quote.ask': Decimal("41.745"),
'quote.bid': Decimal("41.70"),
'quote.datetime': datetime.datetime(2010, 5, 14, 11, 35),
'quote.high': Decimal("43.83"),
'quote.low': Decimal("41.585"),
'quote.nchange': Decimal("-2.095"),
'quote.open': Decimal("43.67"),
'quote.pchange': Decimal("-0.0477"),
'quote.price': Decimal("41.82"),
'quote.volume': Decimal("4260280"),
'share.name': 'ADIDAS',
'share.symbol': 'ADS.DE',
'source.id': 100,
'source.name': u'Yahoo Finance CSV',
'success': True}}

References smm.quote.base.FetchPluginBase._getName(), smm.quote.base.FetchPluginBase.attr2decimal(), smm.quote.yahoo.YahooCSVFetchPlugin.decimal_properties, smm.quote.yahoo.YahooCSVFetchPlugin.field_names, smm.quote.yahoo.YahooCSVFetchPlugin.field_symbols, smm.quote.base.FetchPluginBase.getRemotePage(), smm.quote.base.FetchPluginBase.initShareStruct(), smm.quote.raiffeisen.RaiffeisenFetchPlugin.provider_url, smm.quote.yahoo.YahooCSVFetchPlugin.provider_url, smm.quote.base.FetchPluginBase.timestamp2datetime(), smm.quote.base.toUnicode(), smm.quote.yahoo.YahooCSVFetchPlugin.unicode_properties, and smm.quote.yahoo.YahooCSVFetchPlugin.yahoo2smm.

Here is the call graph for this function:

Member Data Documentation

list smm.quote.yahoo.YahooCSVFetchPlugin.decimal_properties
static
Initial value:
['ask', 'bid', 'high', 'last', 'low', 'net', 'open',
'p_change', 'volume']

Decimal values.

Those returned values will be converted into decimal.Decimal values

Note
Convert only valued needed by SMM.
See Also
yahoo2smm

Referenced by smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent(), and smm.quote.yahoo.YahooWebFetchPlugin.getCurrent().

string smm.quote.yahoo.YahooCSVFetchPlugin.dsep = u','
static

Decimal separator for converting strings to decimal values.

See Also
attr2decimal()
tsep
list smm.quote.yahoo.YahooCSVFetchPlugin.field_names
static
Initial value:
['symbol', 'name', 'last', 'date', 'time', 'net',
'p_change', 'volume', 'bid', 'ask', 'close', 'open',
'day_range', 'year_range', 'eps', 'pe', 'div_date',
'div', 'div_yield', 'cap', 'ex_div', 'avg_vol',
'currency']

Property names.

A symbol correspondes with the symbol listed at the same position in field_symbols.

See Also
field_symbols
Yahoo Symbols

Referenced by smm.quote.yahoo.YahooCSVFetchPlugin.__init__(), and smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent().

list smm.quote.yahoo.YahooCSVFetchPlugin.field_symbols
static
Initial value:
['s', 'n', 'l1', 'd1', 't1', 'c1', 'p2', 'v', 'b', 'a',
'p', 'o', 'm', 'w', 'e', 'r', 'r1', 'd', 'y', 'j1', 'q',
'a2', 'c4']

Yahoo encoded property names.

A property correspondes with the name listed at the same position in field_names.

See Also
field_names
Yahoo Symbols

Referenced by smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent().

int smm.quote.yahoo.YahooCSVFetchPlugin.interface_version = 2
static

Version number of the interface to access and convert the data.

string smm.quote.yahoo.YahooCSVFetchPlugin.logger_name = 'smm.quote.yahoocsv'
static

Name of the instance logger.

string smm.quote.yahoo.YahooCSVFetchPlugin.name = u'Yahoo Finance CSV'
static

Name of the data source.

smm.quote.yahoo.YahooCSVFetchPlugin.properties
int smm.quote.yahoo.YahooCSVFetchPlugin.provider_id = 100
static

Unique provider ID.

string smm.quote.yahoo.YahooCSVFetchPlugin.provider_url = "http://download.finance.yahoo.com/d/quotes.csv"
static

URL to query the data.

Note
We don't use the european Yahoo server, because we've got wrong / incomplete data

Referenced by smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent(), and smm.quote.yahoo.YahooWebFetchPlugin.getCurrent().

smm.quote.yahoo.YahooCSVFetchPlugin.tsep = None
static

Thousands separator for converting strings to decimal values.

See Also
attr2decimal()
dsep
list smm.quote.yahoo.YahooCSVFetchPlugin.unicode_properties
static
Initial value:
['currency.code', 'exchange.symbol',
'share.name', 'share.symbol']

Unicode values.

Those returned values will be converted into Unicode values

Note
Convert only valued needed by SMM.
See Also
yahoo2smm

Referenced by smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent().

tuple smm.quote.yahoo.YahooCSVFetchPlugin.yahoo2smm
static
Initial value:
(
('currency', 'currency.code'),
('errormsg', 'errormsg'),
('exchange.symbol', 'exchange.symbol'),
('ask', 'quote.ask'),
('bid', 'quote.bid'),
('quote.datetime', 'quote.datetime'),
('high', 'quote.high'),
('low', 'quote.low'),
('net', 'quote.nchange'),
('open', 'quote.open'),
('p_change', 'quote.pchange'),
('last', 'quote.price'),
('volume', 'quote.volume'),
('name', 'share.name'),
('symbol', 'share.symbol'),
('success', 'success'),
)

Mapping of Yahoo properties to SMM properties.

Referenced by smm.quote.yahoo.YahooCSVFetchPlugin.getCurrent().


The documentation for this class was generated from the following file: