Skip to content

Commit

Permalink
Update getting started example
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgolec authored Jul 18, 2024
1 parent b18d8df commit 32624b1
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,10 @@ daily historical price data for the past twenty years:
redirect_uri = 'https://127.0.0.1/'
token_path = '/path/to/token.json'
try:
c = auth.client_from_token_file(token_path, api_key, app_secret)
except FileNotFoundError:
c = auth.client_from_manual_flow(
api_key, app_secret, redirect_uri, token_path)
r = c.get_price_history('AAPL',
period_type=client.Client.PriceHistory.PeriodType.YEAR,
period=client.Client.PriceHistory.Period.TWENTY_YEARS,
frequency_type=client.Client.PriceHistory.FrequencyType.DAILY,
frequency=client.Client.PriceHistory.Frequency.DAILY)
assert r.status_code == 200, r.raise_for_status()
c = auth.easy_client(api_key, app_secret, callback_url, token_path)
r = c.get_price_history_every_day('AAPL')
r.raise_for_status()
print(json.dumps(r.json(), indent=4))
Why should I use ``schwab-py``?
Expand Down

0 comments on commit 32624b1

Please sign in to comment.