Skip to content

Commit

Permalink
Corrected SEMI_ANNUALLY in both bbg/bbg_com.py and v3api.py issue #18
Browse files Browse the repository at this point in the history
  • Loading branch information
summerside182 committed Mar 6, 2017
1 parent 021cd8b commit 78baad3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tia/bbg/bbg_com.py
Expand Up @@ -360,12 +360,12 @@ def __init__(self, symbols, fields, start=None, end=None, period='DAILY', overri
fields : string or list
start : start date (if None then use 1 year ago)
end : end date (if None then use today)
period : ('DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMI-ANNUAL', 'YEARLY')
period : ('DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMI_ANNUALLY', 'YEARLY')
ignore_field_errors : bool
ignore_security_errors : bool
"""
Request.__init__(self, ignore_security_error=ignore_security_error, ignore_field_error=ignore_field_error)
assert period in ('DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMI-ANNUAL', 'YEARLY')
assert period in ('DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMI_ANNUALLY', 'YEARLY')
self.symbols = isinstance(symbols, basestring) and [symbols] or symbols
self.fields = isinstance(fields, basestring) and [fields] or fields
self.overrides = overrides or {}
Expand Down Expand Up @@ -518,6 +518,7 @@ def on_event(self, evt, is_final):
idx = response.pop('time')
self.response = DataFrame(response, columns=['open', 'high', 'low', 'close', 'volume', 'events'], index=idx)


class Terminal(object):
@classmethod
def execute_request(cls, request):
Expand Down
4 changes: 2 additions & 2 deletions tia/bbg/v3api.py
Expand Up @@ -277,7 +277,7 @@ class HistoricalDataRequest(Request):
fields: bbg field name(s)
start: (optional) date, date string , or None. If None, defaults to 1 year ago.
end: (optional) date, date string, or None. If None, defaults to today.
period: (optional) periodicity of data [DAILY, WEEKLY, MONTHLY, QUARTERLY, SEMI-ANNUAL, YEARLY]
period: (optional) periodicity of data [DAILY, WEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUALLY, YEARLY]
ignore_security_error: If True, ignore exceptions caused by invalid sids
ignore_field_error: If True, ignore exceptions caused by invalid fields
period_adjustment: (ACTUAL, CALENDAR, FISCAL)
Expand All @@ -300,7 +300,7 @@ def __init__(self, sids, fields, start=None, end=None, period=None, ignore_secur
Request.__init__(self, '//blp/refdata', ignore_security_error=ignore_security_error,
ignore_field_error=ignore_field_error)
period = period or 'DAILY'
assert period in ('DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMI-ANNUAL', 'YEARLY')
assert period in ('DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMI_ANNUALLY', 'YEARLY')
self.is_single_sid = is_single_sid = isinstance(sids, basestring)
self.is_single_field = is_single_field = isinstance(fields, basestring)
self.sids = is_single_sid and [sids] or list(sids)
Expand Down

0 comments on commit 78baad3

Please sign in to comment.