Skip to content

Commit

Permalink
Add user preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgolec committed Apr 19, 2024
1 parent a407524 commit e2e1d57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,8 @@ Transaction History
:members:
:undoc-members:

----------------
User Preferences
----------------

.. automethod:: schwab.client.Client.get_user_preferences
10 changes: 9 additions & 1 deletion schwab/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ def get_transaction(self, account_hash, transaction_id):
account_hash, transaction_id)
return self._get_request(path, {})


##########################################################################
# Price History

Expand Down Expand Up @@ -540,7 +541,6 @@ def get_price_history(
##########################################################################
# Price history utilities


def __normalize_start_and_end_datetimes(self, start_datetime, end_datetime):
if start_datetime is None:
start_datetime = datetime.datetime(year=1971, month=1, day=1)
Expand Down Expand Up @@ -940,3 +940,11 @@ def get_option_chain(
return self._get_request(path, params)


##########################################################################
# User Info and Preferences

def get_user_preferences(self, account_id):
'''Preferences for the logged in account, including all linked
accounts.'''
path = '/trader/v1/userPreference'
return self._get_request(path, ())

0 comments on commit e2e1d57

Please sign in to comment.