Commit 823f858
Support downloading premium exercises with API key (#2)
* feat: add API key support to exercise downloader
Read PYBITES_API_KEY env var and send X-API-Key header when set.
Without it, only free exercises are downloaded.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add API key instructions to README
Explain how to set PYBITES_API_KEY for downloading all premium exercises.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: extract write_all_exercises and auth_status_message for testability
Pull the exercise-writing loop and auth status message out of main()
into standalone functions that can be unit tested.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add tempfile and serde_json dev dependencies for unit tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* update gitignore with default exercises dir created running it locally
* refactor: restore essential comments and move println into write_all_exercises
Restore two comments removed during refactoring that explain *why*
(--test flag purpose, backup rationale for solved exercises). Move
per-exercise println into write_all_exercises for consistency.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 7a583c0 commit 823f858
5 files changed
Lines changed: 372 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments