Skip to content

Commit 80a682e

Browse files
authored
Update getting started example (#157)
1 parent b18d8df commit 80a682e

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

README.rst

+4-12
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,10 @@ daily historical price data for the past twenty years:
7878
redirect_uri = 'https://127.0.0.1/'
7979
token_path = '/path/to/token.json'
8080
81-
try:
82-
c = auth.client_from_token_file(token_path, api_key, app_secret)
83-
except FileNotFoundError:
84-
c = auth.client_from_manual_flow(
85-
api_key, app_secret, redirect_uri, token_path)
86-
87-
r = c.get_price_history('AAPL',
88-
period_type=client.Client.PriceHistory.PeriodType.YEAR,
89-
period=client.Client.PriceHistory.Period.TWENTY_YEARS,
90-
frequency_type=client.Client.PriceHistory.FrequencyType.DAILY,
91-
frequency=client.Client.PriceHistory.Frequency.DAILY)
92-
assert r.status_code == 200, r.raise_for_status()
81+
c = auth.easy_client(api_key, app_secret, callback_url, token_path)
82+
83+
r = c.get_price_history_every_day('AAPL')
84+
r.raise_for_status()
9385
print(json.dumps(r.json(), indent=4))
9486
9587
Why should I use ``schwab-py``?

0 commit comments

Comments
 (0)