From 32624b1c3c75fbc044a4101f709c6b05b82a5a01 Mon Sep 17 00:00:00 2001 From: Alex Golec Date: Thu, 18 Jul 2024 14:57:22 -0700 Subject: [PATCH] Update getting started example --- README.rst | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index db21d83..82eb40d 100644 --- a/README.rst +++ b/README.rst @@ -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``?