Skip to content

Commit a8e3794

Browse files
committed
renamed simple_call_nb.ipynb -> sync_call_nb.ipynb
added sync_call_nb.ipynb information to README.md
1 parent 3c03a86 commit a8e3794

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,36 @@ Python examples that use [`httpx`](https://www.python-httpx.org/) to authenticat
1313
├── requirements.txt # Pinned dependencies
1414
src/
1515
├── .env.example # Environment variable template
16+
├── simple_call_nb.ipynb # Jupyter notebook — synchronous, shared httpx.Client
1617
├── example_sync_httpx.py # Synchronous — direct httpx module calls (no shared client)
1718
├── example_client.py # Synchronous — shared httpx.Client
1819
├── example_async_simple.py # Async — sequential awaits in a loop
1920
├── example_async_gather.py # Async — asyncio.gather() with Semaphore
21+
├── example_async_taskgroup.py # Async — asyncio.TaskGroup with Semaphore
2022
└── async_learn.py # Learning script — ExceptionGroup / except*
2123
```
2224

25+
## Included Notebook
26+
27+
### `src/simple_call_nb.ipynb` — Synchronous, step-by-step Jupyter notebook
28+
29+
Interactive notebook version of the synchronous workflow. Each logical step is a separate cell with a markdown explanation above it, making it easy to run and inspect results incrementally.
30+
31+
Demonstrates:
32+
- `POST /auth/oauth2/v1/token` — OAuth 2.0 Password Grant authentication
33+
- `GET /data/historical-pricing/v1/views/interday-summaries/{ric}` — daily OHLCV data with corporate-action adjustments for 10 RICs
34+
- `POST /auth/oauth2/v1/revoke` — session token revocation using HTTP Basic Auth
35+
- Shared `httpx.Client` inside a `with` block for clean connection-pool teardown
36+
- Wall-clock timing across the full workflow
37+
38+
Notebook structure:
39+
1. Imports
40+
2. Constants (endpoint paths, RIC list)
41+
3. Credentials loaded from `src/.env`
42+
4. Helper functions (`post_authentication`, `post_auth_revoke`, `get_historical_interday_summaries`)
43+
5. Main execution block — authenticate, fetch data sequentially, revoke token
44+
6. Elapsed time output
45+
2346
## Included Scripts
2447

2548
### `src/example_sync_httpx.py` — Synchronous, direct `httpx` calls
@@ -109,6 +132,9 @@ APPKEY_RDP=<RDP AppKey>
109132
## Run
110133

111134
```powershell
135+
# Jupyter notebook (synchronous)
136+
jupyter lab src/simple_call_nb.ipynb
137+
112138
# Synchronous
113139
python .\src\example_client.py
114140

0 commit comments

Comments
 (0)